diff options
Diffstat (limited to 'bin/webp/main.go')
-rw-r--r-- | bin/webp/main.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/webp/main.go b/bin/webp/main.go index a85bb03..93103cb 100644 --- a/bin/webp/main.go +++ b/bin/webp/main.go | |||
@@ -57,6 +57,13 @@ func writeError(w http.ResponseWriter, code int, message string, args ...any) { | |||
57 | type webpConverterHandler struct{} | 57 | type webpConverterHandler struct{} |
58 | 58 | ||
59 | func (h *webpConverterHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | 59 | func (h *webpConverterHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
60 | // Support liveness check | ||
61 | if r.URL.Path == "/ping" { | ||
62 | w.WriteHeader(http.StatusOK) | ||
63 | w.Write([]byte("pong")) | ||
64 | return | ||
65 | } | ||
66 | |||
60 | img, _, err := image.Decode(r.Body) | 67 | img, _, err := image.Decode(r.Body) |
61 | if err != nil { | 68 | if err != nil { |
62 | writeError(w, http.StatusBadRequest, "decode failed: %s", err) | 69 | writeError(w, http.StatusBadRequest, "decode failed: %s", err) |