Commit d0310c8a authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

integration: Add te header field test

parent 8471c9e9
...@@ -796,6 +796,30 @@ func TestH1H2RespPhaseReturn(t *testing.T) { ...@@ -796,6 +796,30 @@ func TestH1H2RespPhaseReturn(t *testing.T) {
} }
} }
// TestH1H2TE tests that "te: trailers" header is forwarded to HTTP/2
// backend server by stripping other encodings.
func TestH1H2TE(t *testing.T) {
st := newServerTester([]string{"--http2-bridge"}, t, func(w http.ResponseWriter, r *http.Request) {
if got, want := r.Header.Get("te"), "trailers"; got != want {
t.Errorf("te: %v; want %v", got, want)
}
})
defer st.Close()
res, err := st.http1(requestParam{
name: "TestH1H2TE",
header: []hpack.HeaderField{
pair("te", "foo,trailers,bar"),
},
})
if err != nil {
t.Fatalf("Error st.http1() = %v", err)
}
if got, want := res.status, 200; got != want {
t.Errorf("status: %v; want %v", got, want)
}
}
// TestH1APIBackendconfig exercise backendconfig API endpoint routine // TestH1APIBackendconfig exercise backendconfig API endpoint routine
// for successful case. // for successful case.
func TestH1APIBackendconfig(t *testing.T) { func TestH1APIBackendconfig(t *testing.T) {
......
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