From 8bbda01e9c273bb7f263414c82fa1447df61ae60 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:54:43 +0000 Subject: [PATCH] Copy content-length header. Closes #8 --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 2ba98fd..10688a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -225,6 +225,10 @@ async fn index(req: HttpRequest) -> Result> { } } + if let Some(content_length) = resp.headers().get("content-length") { + response.append_header(("content-length", content_length)); + } + // Stream response Ok(response.streaming(resp.bytes_stream())) }