fix(ui): add HTTP security headers (#5536)

pull/5538/head
Pavel Závora 2020-07-15 17:56:46 +02:00 committed by GitHub
parent 6b7e6cb1a0
commit 0babc528f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

6
dist/dist.go vendored
View File

@ -36,6 +36,12 @@ func (b *BindataAssets) Handler() http.Handler {
// addCacheHeaders requests an hour of Cache-Control and sets an ETag based on file size and modtime
func (b *BindataAssets) addCacheHeaders(filename string, w http.ResponseWriter) error {
w.Header().Add("Cache-Control", "public, max-age=3600")
w.Header().Add("X-Frame-Options", "SAMEORIGIN")
w.Header().Add("X-XSS-Protection", "1; mode=block")
w.Header().Add("X-Content-Type-Options", "nosniff")
w.Header().Add("Content-Security-Policy", "script-src 'self'; object-src 'self'")
fi, err := AssetInfo(filename)
if err != nil {
return err