Skip to content

Commit 7b21e82

Browse files
committed
fix(admin): better handing of resolve proxy path escaping
fixes #493
1 parent cc4c57b commit 7b21e82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/gonic/gonic.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"log"
1111
"net/http"
1212
"net/http/pprof"
13+
"net/url"
1314
"os"
1415
"os/signal"
1516
"path"
@@ -244,7 +245,9 @@ func main() {
244245
scrobblers := []scrobble.Scrobbler{lastfmClient, listenbrainzClient}
245246

246247
resolveProxyPath := func(in string) string {
247-
return path.Join(*confProxyPrefix, in)
248+
url, _ := url.Parse(in)
249+
url.Path = path.Join(*confProxyPrefix, url.Path)
250+
return url.String()
248251
}
249252

250253
ctrlAdmin, err := ctrladmin.New(dbc, sessDB, scannr, podcast, lastfmClient, resolveProxyPath)

0 commit comments

Comments
 (0)