1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-01-17 13:28:13 +01:00

Fix NO_PROXY settings (#3117)

This commit is contained in:
Gergely Sényi 2023-04-17 18:21:54 +02:00 committed by GitHub
parent 242f1283b0
commit c6f3a35d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -443,7 +443,9 @@ class CurlFactory implements CurlFactoryInterface
$scheme = $easy->request->getUri()->getScheme();
if (isset($options['proxy'][$scheme])) {
$host = $easy->request->getUri()->getHost();
if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
unset($conf[\CURLOPT_PROXY]);
} else {
$conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
}
}