diff --git a/src/Composer/Util/StreamContextFactory.php b/src/Composer/Util/StreamContextFactory.php index 72d12115d..b25b307a1 100644 --- a/src/Composer/Util/StreamContextFactory.php +++ b/src/Composer/Util/StreamContextFactory.php @@ -87,15 +87,15 @@ final class StreamContextFactory // enabled request_fulluri unless it is explicitly disabled switch (parse_url($url, PHP_URL_SCHEME)) { - case 'http': // default request_fulluri to true + case 'http': // default request_fulluri to true for HTTP $reqFullUriEnv = getenv('HTTP_PROXY_REQUEST_FULLURI'); if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) { $options['http']['request_fulluri'] = true; } break; - case 'https': // default request_fulluri to true + case 'https': // default request_fulluri to false for HTTPS $reqFullUriEnv = getenv('HTTPS_PROXY_REQUEST_FULLURI'); - if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) { + if (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv) { $options['http']['request_fulluri'] = true; } break; diff --git a/tests/Composer/Test/Util/StreamContextFactoryTest.php b/tests/Composer/Test/Util/StreamContextFactoryTest.php index 9bb04aaa1..3d60a9a38 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -142,7 +142,6 @@ class StreamContextFactoryTest extends TestCase $expected = array( 'http' => array( 'proxy' => 'tcp://proxyserver.net:80', - 'request_fulluri' => true, 'method' => 'GET', 'header' => array('User-Agent: foo', "Proxy-Authorization: Basic " . base64_encode('username:password')), 'max_redirects' => 20, @@ -173,7 +172,6 @@ class StreamContextFactoryTest extends TestCase $expected = array( 'http' => array( 'proxy' => 'ssl://woopproxy.net:443', - 'request_fulluri' => true, 'method' => 'GET', 'max_redirects' => 20, 'follow_location' => 1,