staticfiles: Re-allow HEAD requests

This commit is contained in:
Matthew Holt 2019-02-16 07:42:44 -07:00
parent c1d6c928e3
commit eb9857137a
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5

View File

@ -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)