From 9ec7184aa1252262a5b59b15995491f782258d7e Mon Sep 17 00:00:00 2001 From: GyDi Date: Sun, 16 Jan 2022 18:20:01 +0800 Subject: [PATCH] fix: put profile request with no proxy --- src-tauri/src/core/profiles.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/core/profiles.rs b/src-tauri/src/core/profiles.rs index 42ee3f4..1581624 100644 --- a/src-tauri/src/core/profiles.rs +++ b/src-tauri/src/core/profiles.rs @@ -312,7 +312,10 @@ pub async fn activate_profile(profile_item: &ProfileItem, info: &ClashInfo) -> R let mut data = HashMap::new(); data.insert("path", temp_path.as_os_str().to_str().unwrap()); - let client = reqwest::Client::new(); + let client = match reqwest::ClientBuilder::new().no_proxy().build() { + Ok(c) => c, + Err(_) => return Err("failed to create http::put".into()), + }; match client.put(server).headers(headers).json(&data).send().await { Ok(_) => Ok(()), Err(err) => Err(format!("request failed `{}`", err.to_string())),