What is the correct way of implementing HEAD?

Skip to first unread message

Kai Hendry

Jan 4, 2019, 3:24:46 AM1/4/19
to Gorilla web toolkit
Currently in my mux app:

app := mux.NewRouter()
app.HandleFunc("/", handleIndex).Methods("GET")
app.HandleFunc("/closest", handleClosest).Methods("GET")
app.HandleFunc("/icon", handleIcon).Methods("GET")

It fails for HEAD requests:

HTTP/2 405

I notice these in my logs & they are from health checkers/pingers.

How should I implement it? Hopefully this is not too silly a question.

Thank you in advance,
Reply all
Reply to author
0 new messages