This commit is contained in:
parent
3a053aeaa4
commit
c2380f4e03
1 changed files with 5 additions and 0 deletions
|
@ -107,6 +107,7 @@ impl<'r> Responder<'r, 'static> for DataResponse {
|
||||||
))
|
))
|
||||||
.header(Header::new("Accept-Ranges", "bytes"))
|
.header(Header::new("Accept-Ranges", "bytes"))
|
||||||
.header(Header::new("Content-Type", self.content_type.clone()))
|
.header(Header::new("Content-Type", self.content_type.clone()))
|
||||||
|
.header(Header::new("Content-Length", sliced_data.len().to_string()))
|
||||||
.status(Status::PartialContent)
|
.status(Status::PartialContent)
|
||||||
.streamed_body(Cursor::new(sliced_data.to_vec()))
|
.streamed_body(Cursor::new(sliced_data.to_vec()))
|
||||||
.finalize());
|
.finalize());
|
||||||
|
@ -150,6 +151,10 @@ impl<'r> Responder<'r, 'static> for DataResponse {
|
||||||
"Content-Type",
|
"Content-Type",
|
||||||
format!("multipart/byteranges; boundary={boundary}"),
|
format!("multipart/byteranges; boundary={boundary}"),
|
||||||
))
|
))
|
||||||
|
.header(Header::new(
|
||||||
|
"Content-Length",
|
||||||
|
multipart_body.len().to_string(),
|
||||||
|
))
|
||||||
.status(Status::PartialContent)
|
.status(Status::PartialContent)
|
||||||
.streamed_body(Cursor::new(multipart_body.to_vec()))
|
.streamed_body(Cursor::new(multipart_body.to_vec()))
|
||||||
.finalize());
|
.finalize());
|
||||||
|
|
Loading…
Add table
Reference in a new issue