Workaround curl bug in 8.7.0/8.7.1, fixes #11913
parent
0d5549f503
commit
a7c6125ee4
|
@ -199,7 +199,7 @@ EOT
|
|||
}
|
||||
|
||||
$io->write('OpenSSL version: ' . (defined('OPENSSL_VERSION_TEXT') ? '<comment>'.OPENSSL_VERSION_TEXT.'</comment>' : '<error>missing</error>'));
|
||||
$io->write('cURL version: ' . $this->getCurlVersion());
|
||||
$io->write('curl version: ' . $this->getCurlVersion());
|
||||
|
||||
$finder = new ExecutableFinder;
|
||||
$hasSystemUnzip = (bool) $finder->find('unzip');
|
||||
|
|
|
@ -221,6 +221,12 @@ class CurlDownloader
|
|||
curl_setopt($curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
}
|
||||
|
||||
// curl 8.7.0 - 8.7.1 has a bug whereas automatic accept-encoding header results in an error when reading the response
|
||||
// https://github.com/composer/composer/issues/11913
|
||||
if (in_array($version['version'], ['8.7.0', '8.7.1'], true) && \defined('CURL_VERSION_LIBZ') && (CURL_VERSION_LIBZ & $features)) {
|
||||
curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
|
||||
}
|
||||
|
||||
$options['http']['header'] = $this->authHelper->addAuthenticationHeader($options['http']['header'], $origin, $url);
|
||||
$options = StreamContextFactory::initOptions($url, $options, true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue