Skip to content

Commit

Permalink
tests: fix blocking test about empty bodies and content-length
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Apr 15, 2024
1 parent 1073881 commit 0f126f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@ fn test_response_text() {
}

#[test]
fn donot_set_conent_length_0_if_have_no_body() {
fn donot_set_content_length_0_if_have_no_body() {
let server = server::http(move |req| async move {
let headers = req.headers();
assert_eq!(headers.get(CONTENT_LENGTH), None);
assert!(headers.get(CONTENT_TYPE).is_none());
assert!(headers.get(TRANSFER_ENCODING).is_none());
dbg!(&headers);
http::Response::default()
});

let url = format!("http://{}/conent-length", server.addr());
let url = format!("http://{}/content-length", server.addr());
let res = reqwest::blocking::Client::builder()
.no_proxy()
.build()
.expect("client builder")
.post(&url)
.get(&url)
.send()
.expect("request");

Expand Down

0 comments on commit 0f126f5

Please sign in to comment.