Copy content-length header.

Closes #8
This commit is contained in:
Kavin 2023-02-28 17:54:43 +00:00
parent 40d0cef105
commit 8bbda01e9c
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -225,6 +225,10 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
} }
} }
if let Some(content_length) = resp.headers().get("content-length") {
response.append_header(("content-length", content_length));
}
// Stream response // Stream response
Ok(response.streaming(resp.bytes_stream())) Ok(response.streaming(resp.bytes_stream()))
} }