Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #22 from dbrgn/empty_upstream_path
Browse files Browse the repository at this point in the history
Handle upstreams without a trailing slash
  • Loading branch information
jehiah committed Nov 8, 2014
2 parents ad57a93 + b3bbc3c commit 23a89b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func NewOauthProxy(proxyUrls []*url.URL, clientID string, clientSecret string, v
serveMux := http.NewServeMux()
for _, u := range proxyUrls {
path := u.Path
if len(path) == 0 {
path = "/"
}
u.Path = ""
log.Printf("mapping %s => %s", path, u)
serveMux.Handle(path, httputil.NewSingleHostReverseProxy(u))
Expand Down

0 comments on commit 23a89b0

Please sign in to comment.