1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

add --proxy-host-header option

This commit is contained in:
Jehiah Czebotar
2015-03-17 15:15:15 -04:00
parent 24ef555547
commit 263e16eeea
7 changed files with 45 additions and 29 deletions

View File

@ -12,7 +12,7 @@ import (
func TestNewReverseProxy(t *testing.T) {
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
hostname, _, _ := net.SplitHostPort(r.Host)
hostname, _, _ := net.SplitHostPort(r.Host)
w.Write([]byte(hostname))
}))
defer backend.Close()
@ -24,6 +24,7 @@ func TestNewReverseProxy(t *testing.T) {
proxyURL, _ := url.Parse(backendURL.Scheme + "://" + backendHost + "/")
proxyHandler := NewReverseProxy(proxyURL)
setProxyUpstreamHostHeader(proxyHandler, proxyURL)
frontend := httptest.NewServer(proxyHandler)
defer frontend.Close()