Skip to content

Commit

Permalink
feat: probe endpoint /status
Browse files Browse the repository at this point in the history
  • Loading branch information
dnplkndll committed Apr 10, 2022
1 parent 8ebe6a8 commit 1b0a3f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/kwkhtmltopdf_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ func httpAbort(w http.ResponseWriter, err error) {
}

func handler(w http.ResponseWriter, r *http.Request) {
log.Printf("%s %s", r.Method, r.URL.Path)

if r.URL.Path == "/status" {
w.WriteHeader(http.StatusOK)
return
} else {
// don't log status
log.Printf("%s %s", r.Method, r.URL.Path)
}
if r.Method != http.MethodPost {
httpError(w, errors.New("http method not allowed: "+r.Method), http.StatusMethodNotAllowed)
return
Expand Down

0 comments on commit 1b0a3f2

Please sign in to comment.