diff --git a/axum/src/routing/tests/mod.rs b/axum/src/routing/tests/mod.rs index 84e93898..cb2666a9 100644 --- a/axum/src/routing/tests/mod.rs +++ b/axum/src/routing/tests/mod.rs @@ -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, "…"); }