mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00:00
optimise (CSP): follow recommendations from mozilla observatory
This commit is contained in:
@@ -45,8 +45,8 @@ func IndexHeaders(fn func(App, http.ResponseWriter, *http.Request)) func(ctx App
|
||||
header.Set("X-Content-Type-Options", "nosniff")
|
||||
header.Set("X-XSS-Protection", "1; mode=block")
|
||||
header.Set("X-Frame-Options", "DENY")
|
||||
header.Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; font-src 'self' data:; manifest-src 'self'; script-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; object-src 'self'; media-src 'self'; worker-src 'self'; form-action 'self'")
|
||||
header.Set("X-Powered-By", fmt.Sprintf("Filestash/%s <https://filestash.app>", APP_VERSION + "." + BUILD_NUMBER))
|
||||
header.Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; font-src 'self' data:; manifest-src 'self'; script-src 'self' 'sha256-JNAde5CZQqXtYRLUk8CGgyJXo6C7Zs1lXPPClLM1YM4=' 'sha256-YLOlqMUx4Lpbv7KARwKdtxDGqHGrAp77cqwdPa4A20w='; img-src 'self' data:; connect-src 'self'; object-src 'self'; media-src 'self'; worker-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'self'")
|
||||
fn(ctx, res, req)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user