From 1cca0ee9735e60a0074746da36f6b40875664d27 Mon Sep 17 00:00:00 2001 From: lanyeeee <1210347077@qq.com> Date: Tue, 8 Oct 2024 05:55:08 +0800 Subject: [PATCH 1/3] feat: remove feature `__internal_proxy_sys_no_cache` --- src/proxy.rs | 14 +++----------- tests/proxy.rs | 4 ---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/proxy.rs b/src/proxy.rs index 880e2452e..61d1202bd 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -7,7 +7,6 @@ use crate::into_url::{IntoUrl, IntoUrlSealed}; use crate::Url; use http::{header::HeaderValue, Uri}; use ipnet::IpNet; -use once_cell::sync::Lazy; use percent_encoding::percent_decode; use std::collections::HashMap; use std::env; @@ -280,13 +279,9 @@ impl Proxy { } pub(crate) fn system() -> Proxy { - let mut proxy = if cfg!(feature = "__internal_proxy_sys_no_cache") { - Proxy::new(Intercept::System(Arc::new(get_sys_proxies( - get_from_platform(), - )))) - } else { - Proxy::new(Intercept::System(SYS_PROXIES.clone())) - }; + let mut proxy = Proxy::new(Intercept::System(Arc::new(get_sys_proxies( + get_from_platform(), + )))); proxy.no_proxy = NoProxy::from_env(); proxy } @@ -876,9 +871,6 @@ impl Dst for Uri { } } -static SYS_PROXIES: Lazy> = - Lazy::new(|| Arc::new(get_sys_proxies(get_from_platform()))); - /// Get system proxies information. /// /// All platforms will check for proxy settings via environment variables. diff --git a/tests/proxy.rs b/tests/proxy.rs index 9231a3267..25d0f615c 100644 --- a/tests/proxy.rs +++ b/tests/proxy.rs @@ -163,7 +163,6 @@ async fn test_no_proxy() { assert_eq!(res.status(), reqwest::StatusCode::OK); } -#[cfg_attr(not(feature = "__internal_proxy_sys_no_cache"), ignore)] #[tokio::test] async fn test_using_system_proxy() { let url = "http://not.a.real.sub.hyper.rs/prox"; @@ -175,9 +174,6 @@ async fn test_using_system_proxy() { async { http::Response::default() } }); - // Note: we're relying on the `__internal_proxy_sys_no_cache` feature to - // check the environment every time. - // save system setting first. let system_proxy = env::var("http_proxy"); // set-up http proxy. From 6b238ad69a61961d4d13ce1db31d97c6741e58ad Mon Sep 17 00:00:00 2001 From: lanyeeee <1210347077@qq.com> Date: Tue, 8 Oct 2024 05:55:41 +0800 Subject: [PATCH 2/3] fix: `proc-macro2@1.0.62` was yanked by the author --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dfd0dbf7..0836a0e96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -272,7 +272,7 @@ jobs: run: | cargo clean cargo update -Z minimal-versions - cargo update -p proc-macro2 --precise 1.0.62 + cargo update -p proc-macro2 --precise 1.0.87 cargo check cargo check --all-features From bdd52abf30f44828976186af9d2d6e1a6ffb2834 Mon Sep 17 00:00:00 2001 From: lanyeeee <1210347077@qq.com> Date: Tue, 8 Oct 2024 05:56:20 +0800 Subject: [PATCH 3/3] feat: remove `__internal_proxy_sys_no_cache` in CI --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0836a0e96..571ad2df6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,16 +91,12 @@ jobs: include: - name: linux / stable - test-features: "--features __internal_proxy_sys_no_cache" - name: linux / beta rust: beta - test-features: "--features __internal_proxy_sys_no_cache" # - name: linux / nightly # rust: nightly - # test-features: "--features __internal_proxy_sys_no_cache" - name: macOS / stable os: macOS-latest - test-features: "--features __internal_proxy_sys_no_cache" - name: windows / stable-x86_64-msvc os: windows-latest