From 3a772c7f7f68b2ac8f115650f6d0e94af206ada0 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 21 Nov 2017 15:01:59 +0100 Subject: [PATCH] allows head requests for /api/health endpoint closes #9955 --- pkg/api/http_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/http_server.go b/pkg/api/http_server.go index eadaa117e86..89456d20d8c 100644 --- a/pkg/api/http_server.go +++ b/pkg/api/http_server.go @@ -194,7 +194,8 @@ func (hs *HttpServer) metricsEndpoint(ctx *macaron.Context) { } func (hs *HttpServer) healthHandler(ctx *macaron.Context) { - if ctx.Req.Method != "GET" || ctx.Req.URL.Path != "/api/health" { + notHeadOrGet := ctx.Req.Method != http.MethodGet && ctx.Req.Method != http.MethodHead + if notHeadOrGet || ctx.Req.URL.Path != "/api/health" { return }