diff --git a/src/Handler/CurlFactory.php b/src/Handler/CurlFactory.php index 0c45089f..e8f5fe8c 100644 --- a/src/Handler/CurlFactory.php +++ b/src/Handler/CurlFactory.php @@ -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]; } }