1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-28 09:08:44 +02:00

Requests are proxied to the Host specified by the target.

This commit is contained in:
John Boxall 2014-11-30 17:13:45 -08:00 committed by Jehiah Czebotar
parent 20a152261c
commit 24ef555547

View File

@ -47,7 +47,13 @@ type OauthProxy struct {
}
func NewReverseProxy(target *url.URL) (proxy *httputil.ReverseProxy) {
return httputil.NewSingleHostReverseProxy(target)
proxy = httputil.NewSingleHostReverseProxy(target)
director := proxy.Director
proxy.Director = func(req *http.Request) {
director(req)
req.Host = target.Host
}
return proxy
}
func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy {