From 1bdb3358b4cc303d22263bee64f19b3dcbf9380e Mon Sep 17 00:00:00 2001 From: Phil Howell Date: Tue, 12 Jan 2016 17:19:27 +0000 Subject: [PATCH] Add health-check endpoint --- imageproxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imageproxy.go b/imageproxy.go index 832fa67..aafcd59 100644 --- a/imageproxy.go +++ b/imageproxy.go @@ -97,6 +97,11 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { return // ignore favicon requests } + if r.URL.Path == "/health-check" { + fmt.Fprint(w, "OK") + return + } + req, err := NewRequest(r, p.DefaultBaseURL) if err != nil { msg := fmt.Sprintf("invalid request URL: %v", err)