Allow HEAD method too

This commit is contained in:
Melon 2025-03-30 02:54:52 +01:00
parent 3f2024f58e
commit cdbf0573d0
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -74,7 +74,10 @@ func cacheBuster(rw http.ResponseWriter, req *http.Request) {
}
func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if req.Method != http.MethodGet {
switch req.Method {
case http.MethodGet, http.MethodHead:
break
default:
http.Error(rw, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return
}