diff options
Diffstat (limited to 'routers/web/metrics.go')
-rw-r--r-- | routers/web/metrics.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/metrics.go b/routers/web/metrics.go index 37558ee337..c7e01b8faa 100644 --- a/routers/web/metrics.go +++ b/routers/web/metrics.go @@ -21,13 +21,13 @@ func Metrics(resp http.ResponseWriter, req *http.Request) { } header := req.Header.Get("Authorization") if header == "" { - http.Error(resp, "", 401) + http.Error(resp, "", http.StatusUnauthorized) return } got := []byte(header) want := []byte("Bearer " + setting.Metrics.Token) if subtle.ConstantTimeCompare(got, want) != 1 { - http.Error(resp, "", 401) + http.Error(resp, "", http.StatusUnauthorized) return } promhttp.Handler().ServeHTTP(resp, req) |