Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Follow up on this pull request
#2059
  • Loading branch information
NaokiM03 committed Aug 31, 2024
1 parent 918961c commit 350733f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,15 @@ async fn async_impl_file_part() {

let ct = format!("multipart/form-data; boundary={}", form.boundary());

let server = server::http(move |mut req| {
let server = server::http(move |req| {
let ct = ct.clone();
let expected_body = expected_body.clone();
async move {
assert_eq!(req.method(), "POST");
assert_eq!(req.headers()["content-type"], ct);
assert_eq!(req.headers()["transfer-encoding"], "chunked");

let mut full: Vec<u8> = Vec::new();
while let Some(item) = req.body_mut().next().await {
full.extend(&*item.unwrap());
}
let full = req.collect().await.unwrap().to_bytes();

assert_eq!(full, expected_body.as_bytes());

Expand Down

0 comments on commit 350733f

Please sign in to comment.