1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

simplify AnyBody and BodySize (#2446)

This commit is contained in:
Rob Ede
2021-11-16 09:21:10 +00:00
committed by GitHub
parent e8a0e16863
commit 4df1cd78b7
17 changed files with 67 additions and 65 deletions

View File

@ -285,9 +285,11 @@ fn prepare_response(
let _ = match size {
BodySize::None | BodySize::Stream => None,
BodySize::Empty => res
BodySize::Sized(0) => res
.headers_mut()
.insert(CONTENT_LENGTH, HeaderValue::from_static("0")),
BodySize::Sized(len) => {
let mut buf = itoa::Buffer::new();