From 067101dbf52a1e3c64f35f8135566abca98548fe Mon Sep 17 00:00:00 2001 From: Matthias Van Woensel <3532563+matthiaz@users.noreply.github.com> Date: Thu, 9 Apr 2020 09:58:34 +0200 Subject: [PATCH] Only send GitHub API token to api.github.com domain (#8747) --- src/Composer/Util/RemoteFilesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 9328d5bdd..f9113d03f 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/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']);