1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-08-30 19:10:20 +02:00

Merge pull request #387 from actix/fix-missing-content-length

fix missing content length
This commit is contained in:
kingoflolz
2018-07-12 16:18:55 +10:00
committed by GitHub

View File

@@ -266,6 +266,10 @@ fn content_encoder(buf: BytesMut, req: &mut ClientRequest) -> Output {
}
#[cfg(not(any(feature = "flate2", feature = "brotli")))]
{
let mut b = BytesMut::new();
let _ = write!(b, "{}", bytes.len());
req.headers_mut()
.insert(CONTENT_LENGTH, HeaderValue::try_from(b.freeze()).unwrap());
TransferEncoding::eof(buf)
}
}