Commit b78662e5 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

integration: Fix errors related to host-rewrite

parent 8a7bc6f7
...@@ -164,7 +164,7 @@ func TestH1H1GracefulShutdown(t *testing.T) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment