Ignore /health endpoint when checking auth

This commit is contained in:
koalaty-code 2019-12-18 14:44:23 -06:00 committed by Aliaksandr Valialkin
parent 5e8e0fbc80
commit aea4c80dd7

View file

@ -203,6 +203,9 @@ func handlerWrapper(w http.ResponseWriter, r *http.Request, rh RequestHandler) {
func checkAuth(w http.ResponseWriter, r *http.Request) bool {
path := r.URL.Path
if path == "/health" {
return true
}
if path == "/metrics" && len(*metricsAuthKey) > 0 {
authKey := r.FormValue("authKey")
if *metricsAuthKey == authKey {