feat: add URL query escape for top level directories
This commit is contained in:
parent
ca3742fb22
commit
0f0a023bb6
3
main.go
3
main.go
@ -5,6 +5,7 @@ import (
|
|||||||
"leech/config"
|
"leech/config"
|
||||||
"leech/route"
|
"leech/route"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||||
@ -28,7 +29,7 @@ func main() {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
for dirName, dirToServe := range config.Config.ServeDirs {
|
for dirName, dirToServe := range config.Config.ServeDirs {
|
||||||
app.Static("/serve/"+dirName, dirToServe)
|
app.Static("/serve/"+url.QueryEscape(dirName), dirToServe)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.Use("/thumb", route.HandleThumb)
|
app.Use("/thumb", route.HandleThumb)
|
||||||
|
Loading…
Reference in New Issue
Block a user