mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 03:03:44 +08:00
parent
e3a500e12c
commit
99851b297d
@ -264,14 +264,18 @@ impl PrfItem {
|
|||||||
// parse the Content-Disposition
|
// parse the Content-Disposition
|
||||||
let filename = match header.get("Content-Disposition") {
|
let filename = match header.get("Content-Disposition") {
|
||||||
Some(value) => {
|
Some(value) => {
|
||||||
let filename = value.to_str().unwrap_or("");
|
let filename = format!("{value:?}");
|
||||||
match help::parse_str::<String>(filename, "filename") {
|
let filename = filename.trim_matches('"');
|
||||||
Some(filename) => Some(filename),
|
match help::parse_str::<String>(filename, "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 => match help::parse_str::<String>(filename, "filename") {
|
||||||
Some(filename) => {
|
Some(filename) => {
|
||||||
let iter = percent_encoding::percent_decode(filename.as_bytes());
|
let filename = filename.trim_matches('"');
|
||||||
let filename = iter.decode_utf8().unwrap_or_default();
|
Some(filename.to_string())
|
||||||
filename.split("''").last().map(|s| s.to_string())
|
|
||||||
}
|
}
|
||||||
None => None,
|
None => None,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user