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:
commit
1124809895
|
@ -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);
|
||||
|
|
Reference in New Issue