mirror of
https://github.com/actix/actix-web.git
synced 2024-06-02 21:39:26 +00:00
Do not encode zero-sized response bodies
This commit is contained in:
parent
4accfab196
commit
438011dd72
|
@ -6,6 +6,10 @@
|
|||
|
||||
- Updated `zstd` dependency to `0.13`.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Do not encode zero-sized response bodies
|
||||
|
||||
## 3.4.0
|
||||
|
||||
### Added
|
||||
|
|
|
@ -52,7 +52,7 @@ impl<B: MessageBody> Encoder<B> {
|
|||
|
||||
pub fn response(encoding: ContentEncoding, head: &mut ResponseHead, body: B) -> Self {
|
||||
// no need to compress an empty body
|
||||
if matches!(body.size(), BodySize::None) {
|
||||
if matches!(body.size(), BodySize::None | BodySize::Sized(0)) {
|
||||
return Self::none();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue