Skip to content

Commit

Permalink
bug #33853 [HttpClient] fix "no_proxy" option ignored in NativeHttpCl…
Browse files Browse the repository at this point in the history
…ient (Harry-Dunne)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix "no_proxy" option ignored in NativeHttpClient

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33832
| License       | MIT
| Doc PR        |

Allow overriding of no_proxy environment variable by passing no_proxy option in NativeHttpClient::request() method.

Commits
-------

e4fb58d [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method
  • Loading branch information
nicolas-grekas committed Oct 4, 2019
2 parents 1d0a077 + e4fb58d commit 1124809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpClient/NativeHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function request(string $method, string $url, array $options = []): Respo
];

$proxy = self::getProxy($options['proxy'], $url);
$noProxy = $_SERVER['no_proxy'] ?? $_SERVER['NO_PROXY'] ?? '';
$noProxy = $options['no_proxy'] ?? $_SERVER['no_proxy'] ?? $_SERVER['NO_PROXY'] ?? '';
$noProxy = $noProxy ? preg_split('/[\s,]+/', $noProxy) : [];

$resolveRedirect = self::createRedirectResolver($options, $host, $proxy, $noProxy, $info, $onProgress);
Expand Down

0 comments on commit 1124809

Please sign in to comment.