Handle upstreams without a trailing slash
This commit is contained in:
parent
14e845d021
commit
b3bbc3ca20
@ -43,6 +43,9 @@ func NewOauthProxy(proxyUrls []*url.URL, clientID string, clientSecret string, v
|
|||||||
serveMux := http.NewServeMux()
|
serveMux := http.NewServeMux()
|
||||||
for _, u := range proxyUrls {
|
for _, u := range proxyUrls {
|
||||||
path := u.Path
|
path := u.Path
|
||||||
|
if len(path) == 0 {
|
||||||
|
path = "/"
|
||||||
|
}
|
||||||
u.Path = ""
|
u.Path = ""
|
||||||
log.Printf("mapping %s => %s", path, u)
|
log.Printf("mapping %s => %s", path, u)
|
||||||
serveMux.Handle(path, httputil.NewSingleHostReverseProxy(u))
|
serveMux.Handle(path, httputil.NewSingleHostReverseProxy(u))
|
||||||
|
Loading…
Reference in New Issue
Block a user