diff --git a/actix-web/src/types/json.rs b/actix-web/src/types/json.rs index 22ed624c3..58464f360 100644 --- a/actix-web/src/types/json.rs +++ b/actix-web/src/types/json.rs @@ -616,7 +616,7 @@ mod tests { } )); - let (req, mut pl) = TestRequest::default() + let (mut req, mut pl) = TestRequest::default() .insert_header(( header::CONTENT_TYPE, header::HeaderValue::from_static("application/json"), @@ -624,6 +624,7 @@ mod tests { .set_payload(Bytes::from_static(&[0u8; 1000])) .to_http_parts(); + req.head_mut().headers_mut().remove(header::CONTENT_LENGTH); let json = JsonBody::::new(&req, &mut pl, None, true) .limit(100) .await;