Skip to content

Commit

Permalink
axum: Add content-length header assertions to `middleware_adding_bo…
Browse files Browse the repository at this point in the history
…dy` test (#3033)
  • Loading branch information
Turbo87 authored Nov 16, 2024
1 parent 17016d6 commit 9ec18b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions axum/src/routing/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,5 +1091,11 @@ async fn middleware_adding_body() {

let client = TestClient::new(app);
let res = client.get("/").await;

let headers = res.headers();
let header = headers.get("content-length");
assert!(header.is_some());
assert_eq!(header.unwrap().to_str().unwrap(), "3");

assert_eq!(res.text().await, "…");
}

0 comments on commit 9ec18b9

Please sign in to comment.