@@ -575,6 +575,7 @@ dependencies = [
"once_cell",
"open 5.0.1",
"parking_lot",
+ "percent-encoding",
"port_scanner",
"reqwest",
"rquickjs",
@@ -40,6 +40,7 @@ reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
tauri = { version = "1.5", features = ["clipboard-all", "global-shortcut-all", "process-all", "shell-all", "system-tray", "updater", "window-all"] }
window-vibrancy = { version = "0.4.3" }
window-shadows = { version = "0.2" }
+percent-encoding = "2.3.1"
[target.'cfg(windows)'.dependencies]
@@ -263,7 +263,17 @@ impl PrfItem {
let filename = match header.get("Content-Disposition") {
Some(value) => {
let filename = value.to_str().unwrap_or("");
- help::parse_str::<String>(filename, "filename=")
+ match help::parse_str::<String>(filename, "filename=") {
+ Some(filename) => Some(filename),
+ None => match help::parse_str::<String>(filename, "filename*=") {
+ Some(filename) => {
+ let iter = percent_encoding::percent_decode(filename.as_bytes());
+ let filename = iter.decode_utf8().unwrap_or_default();
+ filename.split("''").last().map(|s| s.to_string())
+ }
+ None => None,
+ },
}
None => None,
};