mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-29 00:55:51 +08:00
feature (plg_security_svg): admin can decide upon viewing svg documents
This commit is contained in:
@ -235,7 +235,9 @@ func FileCat(ctx App, res http.ResponseWriter, req *http.Request) {
|
||||
header.Set("Content-Length", fmt.Sprintf("%d", contentLength))
|
||||
}
|
||||
header.Set("Content-Type", GetMimeType(req.URL.Query().Get("path")))
|
||||
header.Set("Content-Security-Policy", "script-src 'none'")
|
||||
if header.Get("Content-Security-Policy") == "" {
|
||||
header.Set("Content-Security-Policy", "default-src 'none'; img-src 'self'; style-src 'unsafe-inline'")
|
||||
}
|
||||
header.Set("Accept-Ranges", "bytes")
|
||||
|
||||
// Send data to the client
|
||||
|
||||
Reference in New Issue
Block a user