axum: Add content-length header assertions to middleware_adding_body test (#3033)

This commit is contained in:
Tobias Bieniek 2024-11-16 23:41:27 +01:00 committed by GitHub
parent 17016d6dd6
commit 9ec18b9a5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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, "");
}