staticfiles: HEAD, not OPTIONS

This commit is contained in:
Matthew Holt 2019-02-16 08:22:04 -07:00
parent eb9857137a
commit 33b00dc8b1
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" && r.Method != "OPTIONS" {
if r.Method != "GET" && r.Method != "HEAD" {
return http.StatusMethodNotAllowed, nil
}
return fs.serveFile(w, r)