fix: accessibility and security improvements (#6033)

This commit is contained in:
superafun authored and GitHub committed 2026-07-25 07:30:02 +02:00
1 parent 7361d91ea2
commit b21b1245ae
9 files changed
+40 -15

No files matched your search

+2
View File
@@ -110,6 +110,7 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
}
w.Header().Set("x-xss-protection", "1; mode=block")
w.Header().Set("X-Content-Type-Options", "nosniff")
return handleWithStaticData(w, r, d, assetsFs, "public/index.html", "text/html; charset=utf-8")
}, "", store, server)
@@ -124,6 +125,7 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
const maxAge = 86400 // 1 day
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%v", maxAge))
w.Header().Set("X-Content-Type-Options", "nosniff")
if d.settings.Branding.Files != "" {
if strings.HasPrefix(r.URL.Path, "img/") {