middleware: Heartbeat middleware to respond to HEAD methods as well
This commit is contained in:
parent
df44563f06
commit
ecd468d8a6
1 changed files with 1 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
func Heartbeat(endpoint string) func(http.Handler) http.Handler {
|
||||
f := func(h http.Handler) http.Handler {
|
||||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == "GET" && strings.EqualFold(r.URL.Path, endpoint) {
|
||||
if (r.Method == "GET" || r.Method == "HEAD") && strings.EqualFold(r.URL.Path, endpoint) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("."))
|
||||
|
|
|
|||
Loading…
Reference in a new issue