From aa2bac8bf5d1b0fd6be049700a16ef90b086d458 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 28 Jul 2024 12:15:56 +0200 Subject: [PATCH] Use content-lengh when there is no ranges header --- crates/librqbit/src/http_api.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/librqbit/src/http_api.rs b/crates/librqbit/src/http_api.rs index 890086f..753e3ce 100644 --- a/crates/librqbit/src/http_api.rs +++ b/crates/librqbit/src/http_api.rs @@ -206,12 +206,12 @@ impl HttpApi { )) .context("bug")?, ); - } else { - output_headers.insert( - http::header::CONTENT_LENGTH, - HeaderValue::from_str(&format!("{}", stream.len())).context("bug")?, - ); } + } else { + output_headers.insert( + http::header::CONTENT_LENGTH, + HeaderValue::from_str(&format!("{}", stream.len())).context("bug")?, + ); } let s = tokio_util::io::ReaderStream::new(stream);