소스 검색

Fix RemoteFilesystem::isPublicBitBucketDownload

The access token was added to requests to third party hosts the bitbucket api is redirecting to.
Stefan Grootscholten 8 년 전
부모
커밋
3eeb6214eb
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/Composer/Util/RemoteFilesystem.php

+ 7 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -997,6 +997,13 @@ class RemoteFilesystem
      */
     private function isPublicBitBucketDownload($urlToBitBucketFile)
     {
+        $domain = parse_url($urlToBitBucketFile, PHP_URL_HOST);
+        if (strpos($domain, 'bitbucket.org') === false) {
+            // Bitbucket downloads are hosted on amazonaws.
+            // We do not need to authenticate there at all
+            return true;
+        }
+
         $path = parse_url($urlToBitBucketFile, PHP_URL_PATH);
 
         // Path for a public download follows this pattern /{user}/{repo}/downloads/{whatever}