feat(http2): Strip connection headers before sending

Automatically removes "connection" headers before sending over HTTP2.
These headers are illegal in HTTP2, and would otherwise cause errors.

Closes: #1551
This commit is contained in:
Josh Leeb-du Toit
2018-06-09 10:31:22 +10:00
committed by Sean McArthur
parent a0a0fcdd9b
commit f20afba57d
2 changed files with 132 additions and 27 deletions

View File

@@ -62,6 +62,84 @@ t! {
;
}
t! {
get_strip_connection_header,
client:
request:
uri: "/",
;
response:
status: 200,
headers: {
// h2 doesn't actually receive the connection header
},
body: "hello world",
;
server:
request:
uri: "/",
;
response:
headers: {
// http2 should strip this header
"connection" => "close",
},
body: "hello world",
;
}
t! {
get_strip_keep_alive_header,
client:
request:
uri: "/",
;
response:
status: 200,
headers: {
// h2 doesn't actually receive the keep-alive header
},
body: "hello world",
;
server:
request:
uri: "/",
;
response:
headers: {
// http2 should strip this header
"keep-alive" => "timeout=5, max=1000",
},
body: "hello world",
;
}
t! {
get_strip_upgrade_header,
client:
request:
uri: "/",
;
response:
status: 200,
headers: {
// h2 doesn't actually receive the upgrade header
},
body: "hello world",
;
server:
request:
uri: "/",
;
response:
headers: {
// http2 should strip this header
"upgrade" => "h2c",
},
body: "hello world",
;
}
t! {
get_body_chunked,
client: