From be794e58bfb36b5ab6643f264b67766cd22e4d77 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 16:25:18 +0900 Subject: fix(proxy-manager): read proxy settings from $_SERVER ProxyManager::initProxyData() reads $_SERVER[$name], a startup snapshot, while the port read the live process environment. A putenv() issued after startup changed the proxy the port picked but not the one PHP would pick. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/http/proxy_manager.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/util/http/proxy_manager.rs') diff --git a/crates/shirabe/src/util/http/proxy_manager.rs b/crates/shirabe/src/util/http/proxy_manager.rs index 13f0b521..3101f6e0 100644 --- a/crates/shirabe/src/util/http/proxy_manager.rs +++ b/crates/shirabe/src/util/http/proxy_manager.rs @@ -4,6 +4,7 @@ use crate::downloader::TransportException; use crate::util::NoProxyPattern; use crate::util::http::ProxyItem; use crate::util::http::RequestProxy; +use shirabe_php_shim::PHP_SERVER; use std::sync::Mutex; use std::sync::atomic::{AtomicU64, Ordering}; @@ -133,10 +134,10 @@ impl ProxyManager { fn get_proxy_env(env_name: &str) -> (Option, String) { for name in [env_name.to_lowercase(), env_name.to_uppercase()] { - if let Ok(val) = std::env::var(&name) + if let Some(val) = PHP_SERVER.lock().unwrap().get(&name) && !val.is_empty() { - return (Some(val), name); + return (Some(val.to_string_lossy().into_owned()), name); } } (None, String::new()) -- cgit v1.3.1-4-g156e