8000 [HttpClient] Allow the HTTP_PROXY environment variable lookup with ph… · symfony/symfony@fbd439e · GitHub
[go: up one dir, main page]

Skip to content

Commit fbd439e

Browse files
theofidrynicolas-grekas
authored andcommitted
[HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg
1 parent ca29039 commit fbd439e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private static function getProxy(?string $proxy, array $url): ?array
258258
{
259259
if (null === $proxy) {
260260
// Ignore HTTP_PROXY except on the CLI to work around httpoxy set of vulnerabilities
261-
$proxy = $_SERVER['http_proxy'] ?? ('cli' === \PHP_SAPI ? $_SERVER['HTTP_PROXY'] ?? null : null) ?? $_SERVER['all_proxy'] ?? $_SERVER['ALL_PROXY'] ?? null;
261+
$proxy = $_SERVER['http_proxy'] ?? (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? $_SERVER['HTTP_PROXY'] ?? null : null) ?? $_SERVER['all_proxy'] ?? $_SERVER['ALL_PROXY'] ?? null;
262262

263263
if ('https:' === $url['scheme']) {
264264
$proxy = $_SERVER['https_proxy'] ?? $_SERVER['HTTPS_PROXY'] ?? $proxy;

0 commit comments

Comments
 (0)
0