feat: add URL query escape for top level directories

This commit is contained in:
Louis Dalibard 2024-06-28 18:03:17 +02:00
parent 0f0a023bb6
commit 5c4c8269a4

View File

@ -2,6 +2,7 @@ package main
import ( import (
"embed" "embed"
"fmt"
"leech/config" "leech/config"
"leech/route" "leech/route"
"net/http" "net/http"
@ -29,6 +30,7 @@ func main() {
})) }))
for dirName, dirToServe := range config.Config.ServeDirs { for dirName, dirToServe := range config.Config.ServeDirs {
fmt.Println("Registering route /serve/" + url.QueryEscape(dirName))
app.Static("/serve/"+url.QueryEscape(dirName), dirToServe) app.Static("/serve/"+url.QueryEscape(dirName), dirToServe)
} }