From 599bbf4b52df0063ccd6334bc5b0b2785cbbafa8 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Wed, 10 Jun 2020 19:43:49 +0200 Subject: [PATCH] Proper tilde path clean up. --- handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handler.go b/handler.go index 90d7db3..ab558d0 100644 --- a/handler.go +++ b/handler.go @@ -202,8 +202,7 @@ func resolvePath(path string, config Config) (string, os.FileInfo, error) { username := bits[1][1:] new_prefix := filepath.Join(config.DocBase, config.HomeDocBase, username) path = strings.Replace(path, bits[1], new_prefix, 1) - // TODO: Fix this properly - path = strings.Replace(path, "//", "/", -1) + path = filepath.Clean(path) } else { path = filepath.Join(config.DocBase, path) }