mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
webdav: make HEAD/GET on a dir fail
This commit is contained in:
parent
326c4b9b6f
commit
f4c21ca352
@ -49,6 +49,10 @@ func (b *backend) HeadGet(w http.ResponseWriter, r *http.Request) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fi.IsDir() {
|
||||||
|
return &internal.HTTPError{Code: http.StatusMethodNotAllowed}
|
||||||
|
}
|
||||||
|
|
||||||
http.ServeContent(w, r, r.URL.Path, fi.ModTime(), f)
|
http.ServeContent(w, r, r.URL.Path, fi.ModTime(), f)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user