From c2380f4e03c024c9e896dcfb6343856f942ad69c Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 4 Mar 2025 19:41:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/assets.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/request/assets.rs b/src/request/assets.rs index 1c00dd7..236f268 100644 --- a/src/request/assets.rs +++ b/src/request/assets.rs @@ -107,6 +107,7 @@ impl<'r> Responder<'r, 'static> for DataResponse { )) .header(Header::new("Accept-Ranges", "bytes")) .header(Header::new("Content-Type", self.content_type.clone())) + .header(Header::new("Content-Length", sliced_data.len().to_string())) .status(Status::PartialContent) .streamed_body(Cursor::new(sliced_data.to_vec())) .finalize()); @@ -150,6 +151,10 @@ impl<'r> Responder<'r, 'static> for DataResponse { "Content-Type", format!("multipart/byteranges; boundary={boundary}"), )) + .header(Header::new( + "Content-Length", + multipart_body.len().to_string(), + )) .status(Status::PartialContent) .streamed_body(Cursor::new(multipart_body.to_vec())) .finalize());