소스 검색

Only send GitHub API token to api.github.com domain (#8747)

Matthias Van Woensel 5 년 전
부모
커밋
067101dbf5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Composer/Util/RemoteFilesystem.php

+ 1 - 1
src/Composer/Util/RemoteFilesystem.php

@@ -277,7 +277,7 @@ class RemoteFilesystem
 
         if (isset($options['github-token'])) {
             // only add the access_token if it is actually a github URL (in case we were redirected to S3)
-            if (preg_match('{^https?://([a-z0-9-]+\.)*github\.com/}', $fileUrl)) {
+            if (preg_match('{^https?://api\.github\.com/}', $fileUrl)) {
                 $options['http']['header'][] = 'Authorization: token '.$options['github-token'];
             }
             unset($options['github-token']);