bug #33853 [HttpClient] fix "no_proxy" option ignored in NativeHttpClient (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
-------

e4fb58d1b8 [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method
This commit is contained in:
Nicolas Grekas 2019-10-04 22:46:01 +02:00
commit 1124809895
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac
];
$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);