diff --git a/server.go b/server.go index f247c5d..f9d84a9 100644 --- a/server.go +++ b/server.go @@ -49,6 +49,10 @@ func (b *backend) HeadGet(w http.ResponseWriter, r *http.Request) error { return err } + if fi.IsDir() { + return &internal.HTTPError{Code: http.StatusMethodNotAllowed} + } + http.ServeContent(w, r, r.URL.Path, fi.ModTime(), f) return nil }