From ab686016c91cd43081ce34fed296fdfca2e00b7b Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Sun, 22 Dec 2019 10:16:28 +0100 Subject: [PATCH] Remove redundant type conversion Signed-off-by: Till Faelligen --- common/httpapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/httpapi.go b/common/httpapi.go index 1be05c9d1..7a6792bf0 100644 --- a/common/httpapi.go +++ b/common/httpapi.go @@ -129,7 +129,7 @@ func WrapHandlerInBasicAuth(h http.Handler, b BasicAuth) http.HandlerFunc { if b.Username == "" || b.Password == "" { logrus.Info("Metrics are exposed without protection. Make sure you set up protection at proxy level.") } - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { // Serve without authorization if either Username or Password is unset if b.Username == "" || b.Password == "" { h.ServeHTTP(w, r) @@ -142,7 +142,7 @@ func WrapHandlerInBasicAuth(h http.Handler, b BasicAuth) http.HandlerFunc { return } h.ServeHTTP(w, r) - }) + } } // WrapHandlerInCORS adds CORS headers to all responses, including all error