diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 86af9461c..323848061 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -331,9 +331,6 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository } $data = $this->fetchFile($jsonUrl, 'packages.json'); - if ($this->allowSslDowngrade) { - $this->url = str_replace('https://', 'http://', $this->url); - } // TODO remove this BC notify_batch support if (!empty($data['notify_batch'])) { @@ -358,6 +355,10 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository } } + if ($this->allowSslDowngrade) { + $this->url = str_replace('https://', 'http://', $this->url); + } + if (!empty($data['providers-url'])) { if ('/' === $data['providers-url'][0]) { $this->providersUrl = preg_replace('{(https?://[^/]+).*}i', '$1' . $data['providers-url'], $this->url);