mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 09:26:04 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user