Fix logic (again)
parent
2a913c7a68
commit
c99e19db64
|
@ -13,6 +13,8 @@
|
|||
namespace Composer\Exception;
|
||||
|
||||
/**
|
||||
* Specific exception for Composer\Util\HttpDownloader creation.
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*/
|
||||
class NoSslException extends \RuntimeException
|
||||
|
|
|
@ -75,6 +75,7 @@ final class StreamContextFactory
|
|||
// Add stream proxy options if there is a proxy
|
||||
if (!$forCurl) {
|
||||
$proxy = ProxyManager::getInstance()->getProxyForRequest($url);
|
||||
if ($proxyOptions = $proxy->getContextOptions()) {
|
||||
$isHttpsRequest = 0 === strpos($url, 'https://');
|
||||
|
||||
if ($proxy->isSecure()) {
|
||||
|
@ -88,8 +89,6 @@ final class StreamContextFactory
|
|||
throw new TransportException('You must enable the openssl extension to make https requests through a proxy.');
|
||||
}
|
||||
|
||||
$proxyOptions = $proxy->getContextOptions();
|
||||
|
||||
// Header will be a Proxy-Authorization string or not set
|
||||
if (isset($proxyOptions['http']['header'])) {
|
||||
$options['http']['header'][] = $proxyOptions['http']['header'];
|
||||
|
@ -97,6 +96,7 @@ final class StreamContextFactory
|
|||
}
|
||||
$options = array_replace_recursive($options, $proxyOptions);
|
||||
}
|
||||
}
|
||||
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$phpVersion = 'HHVM ' . HHVM_VERSION;
|
||||
|
|
Loading…
Reference in New Issue