Skip to content

Commit 2629741

Browse files
committed
fix(common): don't use reqwest http proxies
1 parent 9e2b7b9 commit 2629741

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libdd-common/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,14 @@ impl Endpoint {
348348
pub fn to_reqwest_client_builder(&self) -> anyhow::Result<(reqwest::ClientBuilder, String)> {
349349
use anyhow::Context;
350350

351+
// Don't use proxies, as this calls `getenv` which is unsafe and not
352+
// just in theory. It can cause crashes with PHP where php-fpm's env
353+
// configuration will mutate the system environment (it doesn't pass
354+
// it as part of the SAPI env, it changes the actual system env).
351355
let mut builder = reqwest::Client::builder()
352356
.timeout(std::time::Duration::from_millis(self.timeout_ms))
353-
.hickory_dns(!self.use_system_resolver);
357+
.hickory_dns(!self.use_system_resolver)
358+
.no_proxy();
354359

355360
let request_url = match self.url.scheme_str() {
356361
// HTTP/HTTPS endpoints

0 commit comments

Comments
 (0)