~bigbes/core-go

39cd24bd091dd97a4b7ab321a8a6c59e836611bb — Drew DeVault 5 years ago b5e0030
auth: allow /query/metrics w/o authentication
1 files changed, 2 insertions(+), 1 deletions(-)

M auth/middleware.go
M auth/middleware.go => auth/middleware.go +2 -1
@@ 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
			}