From ffab235edd5cc05ba7fe37d0394cd929dc270f65 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 17 Jan 2016 19:43:08 +0000 Subject: [PATCH] Remove code preventing protocol downgrades --- src/Composer/Util/RemoteFilesystem.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index ba40517c4..7ea71c2b0 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -331,14 +331,15 @@ class RemoteFilesystem throw $e; } - if ('http' === parse_url($targetUrl, PHP_URL_SCHEME) && 'https' === $this->scheme) { - // Do not allow protocol downgrade. - // TODO: Currently this will fail if a request goes http -> https -> http - $e = new TransportException('The "'.$this->fileUrl.'" file could not be downloaded, not permitting protocol downgrade'); - $e->setHeaders($http_response_header); - $e->setResponse($result); - throw $e; - } + // TODO: Disabled because this is (probably) different behaviour to PHP following for us. + // if ('http' === parse_url($targetUrl, PHP_URL_SCHEME) && 'https' === $this->scheme) { + // // Do not allow protocol downgrade. + // // TODO: Currently this will fail if a request goes http -> https -> http + // $e = new TransportException('The "'.$this->fileUrl.'" file could not be downloaded, not permitting protocol downgrade'); + // $e->setHeaders($http_response_header); + // $e->setResponse($result); + // throw $e; + // } if ($this->io->isDebug()) { $this->io->writeError(sprintf('Following redirect (%u)', $this->redirects));