Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
X-Content-Type-Options: nosniff
1 parent cae8b88 commit d613ba9Copy full SHA for d613ba9
coderd/coderd.go
@@ -319,6 +319,16 @@ func New(options *Options) *API {
319
next.ServeHTTP(w, r)
320
})
321
},
322
+ // This header stops a browser from trying to MIME-sniff the content type and
323
+ // forces it to stick with the declared content-type. This is the only valid
324
+ // value for this header.
325
+ // See: https://github.com/coder/security/issues/12
326
+ func(next http.Handler) http.Handler {
327
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
328
+ w.Header().Add("X-Content-Type-Options", "nosniff")
329
+ next.ServeHTTP(w, r)
330
+ })
331
+ },
332
httpmw.CSRF(options.SecureAuthCookie),
333
)
334
0 commit comments