From 06809edfccbf5d399e9c5decde420902e204c616 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Tue, 19 May 2020 22:03:44 +0200 Subject: [PATCH] URL escape filenames in directory lisitngs. --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.go b/handler.go index 8c1f3eb..54f90ca 100644 --- a/handler.go +++ b/handler.go @@ -215,7 +215,7 @@ func generateDirectoryListing(path string) string { if uint64(file.Mode().Perm())&0444 != 0444 { continue } - listing += fmt.Sprintf("=> %s %s\n", file.Name(), file.Name()) + listing += fmt.Sprintf("=> %s %s\n", url.PathEscape(file.Name()), file.Name()) } return listing }