mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 19:41:12 +00:00
do not skip content length is no chunking is selected
This commit is contained in:
parent
c8713d045c
commit
781f1a3fef
1 changed files with 4 additions and 1 deletions
|
@ -57,6 +57,7 @@ pub(crate) trait MessageType: Sized {
|
||||||
ctype: ConnectionType,
|
ctype: ConnectionType,
|
||||||
config: &ServiceConfig,
|
config: &ServiceConfig,
|
||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
|
let chunked = self.chunked();
|
||||||
let mut skip_len = length != BodyLength::Stream;
|
let mut skip_len = length != BodyLength::Stream;
|
||||||
|
|
||||||
// Content length
|
// Content length
|
||||||
|
@ -74,8 +75,10 @@ pub(crate) trait MessageType: Sized {
|
||||||
}
|
}
|
||||||
match length {
|
match length {
|
||||||
BodyLength::Stream => {
|
BodyLength::Stream => {
|
||||||
if self.chunked() {
|
if chunked {
|
||||||
dst.extend_from_slice(b"\r\ntransfer-encoding: chunked\r\n")
|
dst.extend_from_slice(b"\r\ntransfer-encoding: chunked\r\n")
|
||||||
|
} else {
|
||||||
|
skip_len = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BodyLength::Empty => {
|
BodyLength::Empty => {
|
||||||
|
|
Loading…
Reference in a new issue