Always set content-type & nosniff

This commit is contained in:
Tim Allclair
2019-01-03 11:13:28 -08:00
parent 10979d4c75
commit ef6cba0b36
6 changed files with 10 additions and 0 deletions

View File

@@ -552,6 +552,8 @@ func (s *ProxyServer) Run() error {
proxyMux := mux.NewPathRecorderMux("kube-proxy")
healthz.InstallHandler(proxyMux)
proxyMux.HandleFunc("/proxyMode", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.Header().Set("X-Content-Type-Options", "nosniff")
fmt.Fprintf(w, "%s", s.ProxyMode)
})
proxyMux.Handle("/metrics", legacyregistry.Handler())