浏览代码

Only downgrade providers but not the notification url

Jordi Boggiano 12 年之前
父节点
当前提交
573b7a0fb7
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/Composer/Repository/ComposerRepository.php

+ 4 - 3
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);