From 1f080cd8e0d896772a830a1c7fb6af3e4c4f65e5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Oct 2024 21:43:56 +0200 Subject: [PATCH] Fix tests and github api header --- src/Package/Updater.php | 2 +- tests/Package/UpdaterTest.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Package/Updater.php b/src/Package/Updater.php index a00964e1c..ba6f3f56b 100644 --- a/src/Package/Updater.php +++ b/src/Package/Updater.php @@ -649,7 +649,7 @@ private function updateGitHubInfo(HttpDownloader $httpDownloader, Package $packa $repoData = $driver->getRepoData(); try { - $opts = ['http' => ['header' => ['Accept: application/vnd.github.v3.html']]]; + $opts = ['http' => ['header' => ['Accept: application/vnd.github.html+json', 'X-GitHub-Api-Version: 2022-11-28']]]; $readme = $httpDownloader->get($baseApiUrl.'/readme', $opts)->getBody(); } catch (\Exception $e) { if (!$e instanceof \Composer\Downloader\TransportException || $e->getCode() !== 404) { diff --git a/tests/Package/UpdaterTest.php b/tests/Package/UpdaterTest.php index 799898671..85ff06b6a 100644 --- a/tests/Package/UpdaterTest.php +++ b/tests/Package/UpdaterTest.php @@ -260,6 +260,7 @@ public function testReadmeParsing(): void

Join our Slack channel Join our Slack Channel!

The Fork CMS team

+ SOURCE; @@ -320,7 +321,8 @@ public function testReadmeParsing(): void

Community

Join our Slack channel Join our Slack Channel!

The Fork CMS team

- + + EXPECTED