1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Add Referrer-Policy and X-Content-Type-Options headers

This commit is contained in:
Alexandre Iooss 2022-12-30 10:35:13 +01:00 committed by Juliusz Chroboczek
parent df55c1e7cc
commit 02e7c7e824

View file

@ -103,6 +103,12 @@ func cspHeader(w http.ResponseWriter, connect string) {
} }
w.Header().Add("Content-Security-Policy", w.Header().Add("Content-Security-Policy",
c+" img-src data: 'self'; media-src blob: 'self'; default-src 'self'") c+" img-src data: 'self'; media-src blob: 'self'; default-src 'self'")
// Make browser stop sending referrer information
w.Header().Add("Referrer-Policy", "no-referrer")
// Require correct MIME type to load CSS and JS
w.Header().Add("X-Content-Type-Options", "nosniff")
} }
func notFound(w http.ResponseWriter) { func notFound(w http.ResponseWriter) {