Serve X-Content-Type-Options: nosniff.

Mozilla HTTP Observatory cares about this (5 points), and there isn't
really any reason not to send it at all times.
This commit is contained in:
Catherine
2025-10-24 09:28:49 +00:00
parent 68343a3dff
commit 26b926293b
+1
View File
@@ -277,6 +277,7 @@ func getPage(w http.ResponseWriter, r *http.Request) error {
io.Copy(w, reader)
}
} else {
w.Header().Set("X-Content-Type-Options", "nosniff")
if entry.ContentType != nil {
// don't let http.ServeContent mime-sniff compressed data
w.Header().Set("Content-Type", *entry.ContentType)