cargo fmt

This commit is contained in:
Martin Algesten
2018-06-22 10:16:37 +02:00
parent 5f975270bf
commit 0a828bb4a5
12 changed files with 37 additions and 38 deletions

View File

@@ -42,14 +42,16 @@ fn content_length_limited() {
}
#[test]
// content-length should be ignored when chunked
fn ignore_content_length_when_chunked() {
// content-length should be ignored when chunked
fn ignore_content_length_when_chunked() {
test::set_handler("/ignore_content_length_when_chunked", |_req, _url| {
test::make_response(
200,
"OK",
vec!["Content-Length: 4", "transfer-encoding: chunked"],
"3\r\nhel\r\nb\r\nlo world!!!\r\n0\r\n\r\n".to_string().into_bytes(),
"3\r\nhel\r\nb\r\nlo world!!!\r\n0\r\n\r\n"
.to_string()
.into_bytes(),
)
});
let resp = get("test://host/ignore_content_length_when_chunked").call();
@@ -57,4 +59,4 @@ fn content_length_limited() {
let mut text = String::new();
reader.read_to_string(&mut text).unwrap();
assert_eq!(text, "hello world!!!");
}
}