From 0f0a023bb6634a6cd2123b4cb63b7a93322c3c7b Mon Sep 17 00:00:00 2001 From: Louis Dalibard Date: Fri, 28 Jun 2024 17:58:28 +0200 Subject: [PATCH] feat: add URL query escape for top level directories --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 81cc596..69fceb8 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "leech/config" "leech/route" "net/http" + "net/url" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/filesystem" @@ -28,7 +29,7 @@ func main() { })) for dirName, dirToServe := range config.Config.ServeDirs { - app.Static("/serve/"+dirName, dirToServe) + app.Static("/serve/"+url.QueryEscape(dirName), dirToServe) } app.Use("/thumb", route.HandleThumb)