Always set content-type & nosniff
Kubernetes-commit: ef6cba0b3635fc99eb658ecd4a29cf63bb234cb6
This commit is contained in:
parent
00a7b50aba
commit
d77c4fc8ba
|
|
@ -121,6 +121,7 @@ func StringFlagPutHandler(setter StringFlagSetterFunc) http.HandlerFunc {
|
|||
// writePlainText renders a simple string response.
|
||||
func writePlainText(statusCode int, text string, w http.ResponseWriter) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
w.WriteHeader(statusCode)
|
||||
fmt.Fprintln(w, text)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue