Skip to content

Commit 05db1fc

Browse files
committed
feat(decompression-plz): added shortcuiting if body is empty
1 parent f4c6d06 commit 05db1fc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

decompression-plz/src/content_length.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub fn add_body_and_update_cl<T>(message: &mut T, body: BytesMut)
88
where
99
T: DecompressTrait,
1010
{
11-
if !body.is_empty() {
12-
update_content_length(message, body.len());
11+
if body.is_empty() {
12+
return;
1313
}
1414

15-
//if let Some(bh) = body_headers {
16-
// message.body_headers_as_mut().replace(bh);
17-
//}
18-
15+
update_content_length(message, body.len());
1916
message.set_body(Body::Raw(body));
2017
}
2118

0 commit comments

Comments
 (0)