From fa1c6b7d831f7c7df8d33543db5201bc20c054dc Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 16 Apr 2017 14:04:30 +0100 Subject: [PATCH] add HEAD note Former-commit-id: 095defa9dd4f0ffb4aeab102fb71c4e855a7f721 [formerly 46884c4247c476474ebb65b38baf12d11c1483e3] [formerly 33ea1547102e67a6974a9cf8c257fad73a350801 [formerly efdcb9fc58be1269cdb13377c0dc7bb074417478]] Former-commit-id: 6f03f62b0a2ba1b1b6303ab6412862187d9ca586 [formerly 216445c62251c57b3b65bd86013d462265972970] Former-commit-id: 493d08bd900c3732450a3c4ad41ffedbf429142d --- 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" }