From 3044bb0c76362a2082f32670afae60c8c262c73a Mon Sep 17 00:00:00 2001 From: Ariel Fridman Date: Mon, 2 Jun 2025 14:28:47 +0300 Subject: [PATCH] Remove dependency on env_proxy ureq 3 supports picking up the proxy env vars by itself, so no need to bring in this dependency with us! --- Cargo.lock | 11 ----------- Cargo.toml | 1 - crates/typst-kit/Cargo.toml | 3 +-- crates/typst-kit/src/download.rs | 8 -------- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88be7be24..9aa49d031 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -738,16 +738,6 @@ dependencies = [ "syn", ] -[[package]] -name = "env_proxy" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a5019be18538406a43b5419a5501461f0c8b49ea7dfda0cfc32f4e51fc44be1" -dependencies = [ - "log", - "url", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -3115,7 +3105,6 @@ version = "0.13.1" dependencies = [ "dirs", "ecow", - "env_proxy", "fastrand", "flate2", "fontdb", diff --git a/Cargo.toml b/Cargo.toml index ce15d3148..01d2841c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ csv = "1" ctrlc = "3.4.1" dirs = "6" ecow = { version = "0.2", features = ["serde"] } -env_proxy = "0.4" fastrand = "2.3" flate2 = "1" fontdb = { version = "0.23", default-features = false } diff --git a/crates/typst-kit/Cargo.toml b/crates/typst-kit/Cargo.toml index e59127d71..ffa7ab465 100644 --- a/crates/typst-kit/Cargo.toml +++ b/crates/typst-kit/Cargo.toml @@ -18,7 +18,6 @@ typst-timing = { workspace = true } typst-utils = { workspace = true } dirs = { workspace = true, optional = true } ecow = { workspace = true } -env_proxy = { workspace = true, optional = true } fastrand = { workspace = true, optional = true } flate2 = { workspace = true, optional = true } fontdb = { workspace = true, optional = true } @@ -41,7 +40,7 @@ default = ["fonts", "packages"] fonts = ["dep:fontdb", "fontdb/memmap", "fontdb/fontconfig"] # Add generic downloading utilities -downloads = ["dep:env_proxy", "dep:native-tls", "dep:ureq", "dep:openssl"] +downloads = ["dep:native-tls", "dep:ureq", "dep:openssl"] # Add package downloading utilities, implies `downloads` packages = ["downloads", "dep:dirs", "dep:flate2", "dep:tar", "dep:fastrand"] diff --git a/crates/typst-kit/src/download.rs b/crates/typst-kit/src/download.rs index 5805a81f0..cc64341ba 100644 --- a/crates/typst-kit/src/download.rs +++ b/crates/typst-kit/src/download.rs @@ -118,14 +118,6 @@ impl Downloader { // Set user agent. builder = builder.user_agent(&self.user_agent); - // Get the network proxy config from the environment and apply it. - if let Some(proxy) = env_proxy::for_url_str(url) - .to_string() - .and_then(|url| ureq::Proxy::new(&url).ok()) - { - builder = builder.proxy(Some(proxy)); - } - // Apply a custom CA certificate if present. let maybe_cert = self.cert().transpose()?.cloned().map_or( RootCerts::PlatformVerifier,