From 24562a246ffbfa446abbbb782efcd70010c7e079 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Thu, 17 Jan 2019 14:01:15 +0100 Subject: [PATCH] move healthcheck before the secret checking (#130) since health checks on AWS target groups do not support sending headers, it's impossible to use the health check when a secret is configured. --- server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 5ccffcf0..52659782 100644 --- a/server.go +++ b/server.go @@ -241,16 +241,16 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) { panic(errInvalidMethod) } - if !checkSecret(r) { - panic(errInvalidSecret) - } - if r.URL.RequestURI() == healthPath { rw.WriteHeader(200) rw.Write(imgproxyIsRunningMsg) return } + if !checkSecret(r) { + panic(errInvalidSecret) + } + ctx := context.Background() if newRelicEnabled {