mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 05:41:50 +01:00
Modify response body only if encoder is not None #997
This commit is contained in:
parent
b0b462581b
commit
f3751d83f8
@ -1,5 +1,11 @@
|
||||
# Changes
|
||||
|
||||
## [0.2.8] - 2019-07-xx
|
||||
|
||||
### Fixed
|
||||
|
||||
* Invalid response with compression middleware enabled, but compression-related features disabled #997
|
||||
|
||||
## [0.2.7] - 2019-07-18
|
||||
|
||||
### Added
|
||||
|
@ -54,15 +54,18 @@ impl<B: MessageBody> Encoder<B> {
|
||||
};
|
||||
|
||||
if can_encode {
|
||||
// Modify response body only if encoder is not None
|
||||
if let Some(enc) = ContentEncoder::encoder(encoding) {
|
||||
update_head(encoding, head);
|
||||
head.no_chunking(false);
|
||||
ResponseBody::Body(Encoder {
|
||||
return ResponseBody::Body(Encoder {
|
||||
body,
|
||||
eof: false,
|
||||
fut: None,
|
||||
encoder: ContentEncoder::encoder(encoding),
|
||||
})
|
||||
} else {
|
||||
encoder: Some(enc),
|
||||
});
|
||||
}
|
||||
}
|
||||
ResponseBody::Body(Encoder {
|
||||
body,
|
||||
eof: false,
|
||||
@ -70,7 +73,6 @@ impl<B: MessageBody> Encoder<B> {
|
||||
encoder: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum EncoderBody<B> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user