mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 02:53:45 +08:00
parent
e3a500e12c
commit
99851b297d
@ -264,15 +264,19 @@ impl PrfItem {
|
||||
// parse the Content-Disposition
|
||||
let filename = match header.get("Content-Disposition") {
|
||||
Some(value) => {
|
||||
let filename = value.to_str().unwrap_or("");
|
||||
match help::parse_str::<String>(filename, "filename") {
|
||||
Some(filename) => Some(filename),
|
||||
None => match help::parse_str::<String>(filename, "filename*") {
|
||||
let filename = format!("{value:?}");
|
||||
let filename = filename.trim_matches('"');
|
||||
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 => match help::parse_str::<String>(filename, "filename") {
|
||||
Some(filename) => {
|
||||
let filename = filename.trim_matches('"');
|
||||
Some(filename.to_string())
|
||||
}
|
||||
None => None,
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user