fix: put profile request with no proxy

This commit is contained in:
GyDi 2022-01-16 18:20:01 +08:00
parent 4e2cb30db7
commit 9ec7184aa1
No known key found for this signature in database
GPG Key ID: 1C95E0D3467B3084

View File

@ -312,7 +312,10 @@ pub async fn activate_profile(profile_item: &ProfileItem, info: &ClashInfo) -> R
let mut data = HashMap::new(); let mut data = HashMap::new();
data.insert("path", temp_path.as_os_str().to_str().unwrap()); 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 { match client.put(server).headers(headers).json(&data).send().await {
Ok(_) => Ok(()), Ok(_) => Ok(()),
Err(err) => Err(format!("request failed `{}`", err.to_string())), Err(err) => Err(format!("request failed `{}`", err.to_string())),