mirror of
https://github.com/1f349/site-hosting.git
synced 2025-04-12 22:56:02 +01:00
Allow HEAD method too
This commit is contained in:
parent
3f2024f58e
commit
cdbf0573d0
@ -74,7 +74,10 @@ func cacheBuster(rw http.ResponseWriter, req *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) ServeHTTP(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)
|
http.Error(rw, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user