add HEAD note

pull/144/head
Henrique Dias 2017-04-16 14:04:30 +01:00
parent 9bd3c18a2a
commit efdcb9fc58
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,7 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err
}
switch r.Method {
case "GET":
case "GET", "HEAD":
// Excerpt from RFC4918, section 9.4:
//
// GET, when applied to a collection, may return the contents of an
@ -89,6 +89,7 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err
break
}
// TODO: since HEAD shouldn't return any body, we should make a wrapper here...
if i.IsDir() {
r.Method = "PROPFIND"
}