From 8eb1d10bae954b95c3e3592b00652a7d5e2b3c1c Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 19 May 2024 16:17:44 -0500 Subject: [PATCH] Don't add empty bytes to queue --- actix-http/src/h1/big_bytes.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actix-http/src/h1/big_bytes.rs b/actix-http/src/h1/big_bytes.rs index 63fb78f0..b845d917 100644 --- a/actix-http/src/h1/big_bytes.rs +++ b/actix-http/src/h1/big_bytes.rs @@ -47,8 +47,10 @@ impl BigBytes { self.frozen.push_back(current); } - self.frozen_len += bytes.len(); - self.frozen.push_back(bytes); + if !bytes.is_empty() { + self.frozen_len += bytes.len(); + self.frozen.push_back(bytes); + } } // Returns a slice of the frontmost buffer