auth: allow /query/metrics w/o authentication

This commit is contained in:
Drew DeVault 2021-07-21 09:36:26 +02:00
parent b5e0030f8d
commit 39cd24bd09
1 changed files with 2 additions and 1 deletions

View File

@ -688,7 +688,8 @@ func Middleware(conf ini.File, apiconf string) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if !strings.HasPrefix(r.URL.Path, "/query") {
if !strings.HasPrefix(r.URL.Path, "/query") ||
r.URL.Path == "/query/metrics" {
next.ServeHTTP(w, r)
return
}