1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 00:44:26 +02:00

refactor RequestHead/ResponseHead

This commit is contained in:
Nikolay Kim
2019-03-27 10:38:01 -07:00
parent fb9c94c3e0
commit 3edc515bac
13 changed files with 191 additions and 132 deletions

View File

@ -12,7 +12,7 @@ use flate2::write::{GzEncoder, ZlibEncoder};
use crate::body::{Body, BodySize, MessageBody, ResponseBody};
use crate::http::header::{ContentEncoding, CONTENT_ENCODING};
use crate::http::{HeaderValue, HttpTryFrom, StatusCode};
use crate::{Error, Head, ResponseHead};
use crate::{Error, ResponseHead};
use super::Writer;
@ -56,7 +56,7 @@ impl<B: MessageBody> Encoder<B> {
})
} else {
update_head(encoding, head);
head.no_chunking = false;
head.no_chunking(false);
ResponseBody::Body(Encoder {
body: EncoderBody::Other(stream),
encoder: ContentEncoder::encoder(encoding),
@ -72,7 +72,7 @@ impl<B: MessageBody> Encoder<B> {
})
} else {
update_head(encoding, head);
head.no_chunking = false;
head.no_chunking(false);
ResponseBody::Body(Encoder {
body: EncoderBody::Body(stream),
encoder: ContentEncoder::encoder(encoding),