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

Handle upstreams without a trailing slash #22

Merged
merged 1 commit into from
Nov 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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