fix(headers): Support multiple Content-Length values on same line (#2471)
Closes #2470
This commit is contained in:
@@ -1043,6 +1043,30 @@ test! {
|
||||
error: |err| err.to_string() == "request has unsupported HTTP version",
|
||||
}
|
||||
|
||||
test! {
|
||||
name: client_handles_contentlength_values_on_same_line,
|
||||
|
||||
server:
|
||||
expected: "GET /foo HTTP/1.1\r\nhost: {addr}\r\n\r\n",
|
||||
reply: "\
|
||||
HTTP/1.1 200 OK\r\n\
|
||||
Content-Length: 3,3\r\n\
|
||||
Content-Length: 3,3\r\n\
|
||||
\r\n\
|
||||
abc\r\n",
|
||||
|
||||
client:
|
||||
request: {
|
||||
method: GET,
|
||||
url: "http://{addr}/foo",
|
||||
},
|
||||
response:
|
||||
status: OK,
|
||||
headers: {
|
||||
},
|
||||
body: &b"abc"[..],
|
||||
}
|
||||
|
||||
mod dispatch_impl {
|
||||
use super::*;
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
Reference in New Issue
Block a user