1
0
Fork 0

Only downgrade providers but not the notification url

pull/1625/merge
Jordi Boggiano 2013-02-27 13:32:21 +01:00
parent 88ae6c023b
commit 573b7a0fb7
1 changed files with 4 additions and 3 deletions

View File

@ -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);