feat: add URL query escape for top level directories
This commit is contained in:
parent
0f0a023bb6
commit
5c4c8269a4
2
main.go
2
main.go
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user