diff --git a/src-tauri/src/utils/fetch.rs b/src-tauri/src/utils/fetch.rs index 26fa135..a4031ef 100644 --- a/src-tauri/src/utils/fetch.rs +++ b/src-tauri/src/utils/fetch.rs @@ -54,20 +54,20 @@ pub async fn fetch_profile(url: &str, with_proxy: bool) -> Option(name, "filename="); + format!("{}.yaml", now) + }; - match name { - Some(f) => (f, file), - None => (file.clone(), file), + let name = match header.get("Content-Disposition") { + Some(name) => { + let name = name.to_str().unwrap(); + parse_string::(name, "filename=").unwrap_or(file.clone()) } + None => file.clone(), }; // get the data