fix(client): HTTP/1 client "Transfer-Encoding" repair code would panic (#2410)

Closes #2409
This commit is contained in:
Ivan Nikulin
2021-01-26 18:36:58 +00:00
committed by GitHub
parent 1928682b33
commit 2c8121f173
2 changed files with 33 additions and 3 deletions

View File

@@ -401,6 +401,36 @@ test! {
body: None,
}
test! {
name: client_transfer_encoding_repair,
server:
expected: "\
GET / HTTP/1.1\r\n\
transfer-encoding: foo, chunked\r\n\
host: {addr}\r\n\
\r\n\
5\r\n\
hello\r\n\
0\r\n\r\n\
",
reply: REPLY_OK,
client:
request: {
method: GET,
url: "http://{addr}/",
headers: {
"transfer-encoding" => "foo",
},
body: "hello", // not Body::empty
},
response:
status: OK,
headers: {},
body: None,
}
test! {
name: client_get_req_body_chunked_http10,