Respect NO_PROXY env var (#33742)

Closes #22991

Release Notes:

- Added support for respecting the NO_PROXY environment variable when
any HTTP proxy is configured. For the exact NO_PROXY env var strings
that are supported, see [NoProxy in the reqwest
docs](https://docs.rs/reqwest/latest/reqwest/struct.NoProxy.html#method.from_env).

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
This commit is contained in:
Richard Feldman 2025-07-02 10:05:34 -04:00 committed by GitHub
parent c15d02454e
commit 903212b7f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View file

@ -61,7 +61,8 @@ impl ReqwestClient {
})
.ok()
}) {
client = client.proxy(proxy);
// Respect NO_PROXY env var
client = client.proxy(proxy.no_proxy(reqwest::NoProxy::from_env()));
client_has_proxy = true;
} else {
client_has_proxy = false;