From efdcb9fc58be1269cdb13377c0dc7bb074417478 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 16 Apr 2017 14:04:30 +0100 Subject: [PATCH] add HEAD note --- filemanager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filemanager.go b/filemanager.go index 7e787683..2536cacb 100644 --- a/filemanager.go +++ b/filemanager.go @@ -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" }