diff --git a/src/main.rs b/src/main.rs index ea1420d..95e143a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,7 +142,7 @@ async fn index(req: HttpRequest) -> Result> { } // parse query string - let query = QString::from(req.query_string()); + let mut query = QString::from(req.query_string()); #[cfg(feature = "qhash")] { @@ -236,6 +236,14 @@ async fn index(req: HttpRequest) -> Result> { let mime_type = query.get("mime").map(|s| s.to_string()); + if is_ump && !query.has("range") { + if let Some(range) = req.headers().get("range") { + let range = range.to_str().unwrap(); + let range = range.replace("bytes=", ""); + query.add_pair(("range", range)); + } + } + let qs = { let collected = query .into_pairs()