mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
committed by
GitHub
parent
fb6744daa4
commit
d06efc7704
5
.changes/range-parse-asterisk.md
Normal file
5
.changes/range-parse-asterisk.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Allow range in the form of `bytes=0-*` on the asset protocol.
|
||||
@@ -558,11 +558,18 @@ impl<R: Runtime> WindowManager<R> {
|
||||
}
|
||||
};
|
||||
// parse the range
|
||||
let range = match crate::runtime::http::HttpRange::parse(&range, file_size) {
|
||||
let range = match crate::runtime::http::HttpRange::parse(
|
||||
&if range.ends_with("-*") {
|
||||
range.chars().take(range.len() - 1).collect::<String>()
|
||||
} else {
|
||||
range.clone()
|
||||
},
|
||||
file_size,
|
||||
) {
|
||||
Ok(r) => r,
|
||||
Err(e) => {
|
||||
#[cfg(debug_assertions)]
|
||||
eprintln!("Failed to parse range: {:?}", e);
|
||||
eprintln!("Failed to parse range {}: {:?}", range, e);
|
||||
return (headers, 400, buf);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user