integration: Fix errors related to host-rewrite
This commit is contained in:
parent
8a7bc6f7bc
commit
b78662e506
|
@ -164,7 +164,7 @@ func TestH1H1GracefulShutdown(t *testing.T) {
|
||||||
|
|
||||||
// TestH1H1HostRewrite tests that server rewrites Host header field
|
// TestH1H1HostRewrite tests that server rewrites Host header field
|
||||||
func TestH1H1HostRewrite(t *testing.T) {
|
func TestH1H1HostRewrite(t *testing.T) {
|
||||||
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester([]string{"--host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
@ -212,7 +212,7 @@ func TestH1H1HTTP10(t *testing.T) {
|
||||||
// field using actual backend server even if --no-http-rewrite is
|
// field using actual backend server even if --no-http-rewrite is
|
||||||
// used.
|
// used.
|
||||||
func TestH1H1HTTP10NoHostRewrite(t *testing.T) {
|
func TestH1H1HTTP10NoHostRewrite(t *testing.T) {
|
||||||
st := newServerTester([]string{"--no-host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
@ -429,7 +429,7 @@ func TestH1H2HTTP10(t *testing.T) {
|
||||||
// field using actual backend server even if --no-http-rewrite is
|
// field using actual backend server even if --no-http-rewrite is
|
||||||
// used.
|
// used.
|
||||||
func TestH1H2HTTP10NoHostRewrite(t *testing.T) {
|
func TestH1H2HTTP10NoHostRewrite(t *testing.T) {
|
||||||
st := newServerTester([]string{"--http2-bridge", "--no-host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester([]string{"--http2-bridge"}, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
|
|
@ -195,7 +195,7 @@ func TestH2H1NoVia(t *testing.T) {
|
||||||
|
|
||||||
// TestH2H1HostRewrite tests that server rewrites host header field
|
// TestH2H1HostRewrite tests that server rewrites host header field
|
||||||
func TestH2H1HostRewrite(t *testing.T) {
|
func TestH2H1HostRewrite(t *testing.T) {
|
||||||
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester([]string{"--host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
@ -217,7 +217,7 @@ func TestH2H1HostRewrite(t *testing.T) {
|
||||||
// TestH2H1NoHostRewrite tests that server does not rewrite host
|
// TestH2H1NoHostRewrite tests that server does not rewrite host
|
||||||
// header field
|
// header field
|
||||||
func TestH2H1NoHostRewrite(t *testing.T) {
|
func TestH2H1NoHostRewrite(t *testing.T) {
|
||||||
st := newServerTester([]string{"--no-host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
@ -813,7 +813,7 @@ func TestH2H2ConnectFailure(t *testing.T) {
|
||||||
|
|
||||||
// TestH2H2HostRewrite tests that server rewrites host header field
|
// TestH2H2HostRewrite tests that server rewrites host header field
|
||||||
func TestH2H2HostRewrite(t *testing.T) {
|
func TestH2H2HostRewrite(t *testing.T) {
|
||||||
st := newServerTester([]string{"--http2-bridge"}, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester([]string{"--http2-bridge", "--host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
@ -835,7 +835,7 @@ func TestH2H2HostRewrite(t *testing.T) {
|
||||||
// TestH2H2NoHostRewrite tests that server does not rewrite host
|
// TestH2H2NoHostRewrite tests that server does not rewrite host
|
||||||
// header field
|
// header field
|
||||||
func TestH2H2NoHostRewrite(t *testing.T) {
|
func TestH2H2NoHostRewrite(t *testing.T) {
|
||||||
st := newServerTester([]string{"--http2-bridge", "--no-host-rewrite"}, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester([]string{"--http2-bridge"}, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("request-host", r.Host)
|
w.Header().Add("request-host", r.Host)
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
|
Loading…
Reference in New Issue