Fix metrics auth token detection (#6006) (#6017)

Backport of #6006 

Signed-off-by: Pauls Barkans <paulsb@gmail.com>
This commit is contained in:
Paul 2019-02-09 16:35:51 +02:00 committed by zeripath
parent b0b574f805
commit 7f7c451de4

View File

@ -17,7 +17,7 @@ func Metrics(ctx *context.Context) {
promhttp.Handler().ServeHTTP(ctx.Resp, ctx.Req.Request) promhttp.Handler().ServeHTTP(ctx.Resp, ctx.Req.Request)
return return
} }
header := ctx.Header().Get("Authorization") header := ctx.Req.Header.Get("Authorization")
if header == "" { if header == "" {
ctx.Error(401) ctx.Error(401)
return return