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

@@ -299,6 +299,8 @@ func installMetricHandler(pathRecorderMux *mux.PathRecorderMux) {
pathRecorderMux.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
if req.Method == "DELETE" {
metrics.Reset()
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.Header().Set("X-Content-Type-Options", "nosniff")
io.WriteString(w, "metrics reset\n")
return
}