fix: http range underflow (#690)

This commit is contained in:
sigoden
2026-04-25 17:59:44 +08:00
committed by GitHub
parent 43c778182b
commit 19dc2c205a
2 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ pub fn parse_range(range: &str, size: u64) -> Option<Vec<(u64, u64)>> {
result.push((start, size - 1));
} else {
let end = end.parse::<u64>().ok()?;
if end < size {
if end < size && start <= end {
result.push((start, end));
} else {
return None;