Fix formatting and remove enabled toggle
This commit is contained in:
1 parent
362b3740ed
commit
dcc48860b8
4 files changed
+8
-13
No files matched your search
@@ -246,11 +246,11 @@ func (hs *HTTPServer) metricsEndpoint(ctx *macaron.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if hs.Cfg.MetricsEndpointBasicAuthEnabled {
|
||||
if !util.BasicAuthenticatedRequest(ctx.Req, hs.Cfg.MetricsEndpointBasicAuthUsername, hs.Cfg.MetricsEndpointBasicAuthPassword) {
|
||||
ctx.Resp.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
if hs.Cfg.MetricsEndpointBasicAuthUsername != "" &&
|
||||
hs.Cfg.MetricsEndpointBasicAuthPassword != "" &&
|
||||
!util.BasicAuthenticatedRequest(ctx.Req, hs.Cfg.MetricsEndpointBasicAuthUsername, hs.Cfg.MetricsEndpointBasicAuthPassword) {
|
||||
ctx.Resp.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}).
|
||||
|
||||
Reference in new issue
Block a user