From eb9857137a10155fc8d584495ee9384841833cd8 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 16 Feb 2019 07:42:44 -0700 Subject: [PATCH] staticfiles: Re-allow HEAD requests --- caddyhttp/staticfiles/fileserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddyhttp/staticfiles/fileserver.go b/caddyhttp/staticfiles/fileserver.go index 93a7c6d8..00f03284 100644 --- a/caddyhttp/staticfiles/fileserver.go +++ b/caddyhttp/staticfiles/fileserver.go @@ -53,7 +53,7 @@ type FileServer struct { // ServeHTTP serves static files for r according to fs's configuration. func (fs FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { - if r.Method != "GET" { + if r.Method != "GET" && r.Method != "OPTIONS" { return http.StatusMethodNotAllowed, nil } return fs.serveFile(w, r)