Skip to content

Commit

Permalink
fix(admin): better handing of resolve proxy path escaping
Browse files Browse the repository at this point in the history
fixes #493
  • Loading branch information
sentriz committed Apr 7, 2024
1 parent cc4c57b commit 7b21e82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/gonic/gonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"log"
"net/http"
"net/http/pprof"
"net/url"
"os"
"os/signal"
"path"
Expand Down Expand Up @@ -244,7 +245,9 @@ func main() {
scrobblers := []scrobble.Scrobbler{lastfmClient, listenbrainzClient}

resolveProxyPath := func(in string) string {
return path.Join(*confProxyPrefix, in)
url, _ := url.Parse(in)
url.Path = path.Join(*confProxyPrefix, url.Path)
return url.String()
}

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

0 comments on commit 7b21e82

Please sign in to comment.