mirror of https://github.com/fafhrd91/actix-web
There is no need to set no_chunking
This commit is contained in:
parent
c0e7caed67
commit
fde825f02e
|
@ -584,8 +584,7 @@ impl Service for FilesService {
|
|||
named_file.flags = self.file_flags;
|
||||
let (req, _) = req.into_parts();
|
||||
match named_file.into_response(&req) {
|
||||
Ok(mut item) => {
|
||||
item.head_mut().no_chunking(true);
|
||||
Ok(item) => {
|
||||
Either::Left(ok(ServiceResponse::new(req.clone(), item)))
|
||||
}
|
||||
Err(e) => Either::Left(ok(ServiceResponse::from_err(e, req))),
|
||||
|
|
|
@ -388,11 +388,12 @@ impl NamedFile {
|
|||
fut: None,
|
||||
counter: 0,
|
||||
};
|
||||
if offset != 0 {
|
||||
Ok(resp.status(StatusCode::PARTIAL_CONTENT).streaming(reader))
|
||||
} else {
|
||||
Ok(resp.body(SizedStream::new(length, reader)))
|
||||
|
||||
if offset != 0 || length != self.md.len() {
|
||||
resp.status(StatusCode::PARTIAL_CONTENT);
|
||||
}
|
||||
|
||||
Ok(resp.body(SizedStream::new(length, reader)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue