From b78662e506aa14e78d835ef0d2b100e3f1312042 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 9 Aug 2015 01:23:58 +0900 Subject: [PATCH] integration: Fix errors related to host-rewrite --- integration-tests/nghttpx_http1_test.go | 6 +++--- integration-tests/nghttpx_http2_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/integration-tests/nghttpx_http1_test.go b/integration-tests/nghttpx_http1_test.go index 1fc8e25c..71aeeb85 100644 --- a/integration-tests/nghttpx_http1_test.go +++ b/integration-tests/nghttpx_http1_test.go @@ -164,7 +164,7 @@ func TestH1H1GracefulShutdown(t *testing.T) { // TestH1H1HostRewrite tests that server rewrites Host header field 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) }) defer st.Close() @@ -212,7 +212,7 @@ func TestH1H1HTTP10(t *testing.T) { // field using actual backend server even if --no-http-rewrite is // used. 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) }) defer st.Close() @@ -429,7 +429,7 @@ func TestH1H2HTTP10(t *testing.T) { // field using actual backend server even if --no-http-rewrite is // used. 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) }) defer st.Close() diff --git a/integration-tests/nghttpx_http2_test.go b/integration-tests/nghttpx_http2_test.go index 542e4c37..5fe4c3db 100644 --- a/integration-tests/nghttpx_http2_test.go +++ b/integration-tests/nghttpx_http2_test.go @@ -195,7 +195,7 @@ func TestH2H1NoVia(t *testing.T) { // TestH2H1HostRewrite tests that server rewrites host header field 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) }) defer st.Close() @@ -217,7 +217,7 @@ func TestH2H1HostRewrite(t *testing.T) { // TestH2H1NoHostRewrite tests that server does not rewrite host // header field 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) }) defer st.Close() @@ -813,7 +813,7 @@ func TestH2H2ConnectFailure(t *testing.T) { // TestH2H2HostRewrite tests that server rewrites host header field 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) }) defer st.Close() @@ -835,7 +835,7 @@ func TestH2H2HostRewrite(t *testing.T) { // TestH2H2NoHostRewrite tests that server does not rewrite host // header field 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) }) defer st.Close()