|
@@ -212,6 +212,12 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|
panic(errInvalidSecret)
|
|
panic(errInvalidSecret)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if r.URL.RequestURI() == healthPath {
|
|
|
|
+ rw.WriteHeader(200)
|
|
|
|
+ rw.Write(imgproxyIsRunningMsg)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
ctx := context.Background()
|
|
ctx := context.Background()
|
|
|
|
|
|
if newRelicEnabled {
|
|
if newRelicEnabled {
|
|
@@ -228,12 +234,6 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|
h.lock()
|
|
h.lock()
|
|
defer h.unlock()
|
|
defer h.unlock()
|
|
|
|
|
|
- if r.URL.RequestURI() == healthPath {
|
|
|
|
- rw.WriteHeader(200)
|
|
|
|
- rw.Write(imgproxyIsRunningMsg)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
ctx, timeoutCancel := startTimer(ctx, time.Duration(conf.WriteTimeout)*time.Second)
|
|
ctx, timeoutCancel := startTimer(ctx, time.Duration(conf.WriteTimeout)*time.Second)
|
|
defer timeoutCancel()
|
|
defer timeoutCancel()
|
|
|
|
|