1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

fix Bodyencoding trait usage

This commit is contained in:
Nikolay Kim
2019-12-18 09:30:14 +06:00
parent 3b860ebdc7
commit 1732ae8c79
7 changed files with 24 additions and 21 deletions

View File

@ -268,7 +268,7 @@ impl NamedFile {
);
});
if let Some(current_encoding) = self.encoding {
resp.set_encoding(current_encoding);
resp.encoding(current_encoding);
}
let reader = ChunkedReadFile {
size: self.md.len(),
@ -335,7 +335,7 @@ impl NamedFile {
});
// default compressing
if let Some(current_encoding) = self.encoding {
resp.set_encoding(current_encoding);
resp.encoding(current_encoding);
}
resp.if_some(last_modified, |lm, resp| {
@ -356,7 +356,7 @@ impl NamedFile {
if let Ok(rangesvec) = HttpRange::parse(rangesheader, length) {
length = rangesvec[0].length;
offset = rangesvec[0].start;
resp.set_encoding(ContentEncoding::Identity);
resp.encoding(ContentEncoding::Identity);
resp.header(
header::CONTENT_RANGE,
format!(