Преглед на файлове

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.
Koen Punt преди 6 години
родител
ревизия
24562a246f
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      server.go

+ 4 - 4
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 {