Skip to content

Commit

Permalink
Fix tests and github api header
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Oct 3, 2024
1 parent 2e2949c commit 1f080cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Package/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion tests/Package/UpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public function testReadmeParsing(): void
<p dir="auto"><a href="https://fork-cms.herokuapp.com" rel="nofollow"><img src="https://camo.githubusercontent.com/f21b09fbe2280a6ee4a1badd19dd95404a233c132c021239d80d07a5e44bc8ec/68747470733a2f2f696d6775722e636f6d2f7a5875765264772e706e67" alt="Join our Slack channel" data-canonical-src="https://imgur.com/zXuvRdw.png" style="max-width: 100%;"> Join our Slack Channel!</a></p>
<p dir="auto"><em>The Fork CMS team</em></p>
<img src="https://private-user-images.githubusercontent.com/abcdef">
<a href="https://private-user-images.githubusercontent.com/42083846/370308489-1bf9b427-0daf-4b69-9b45-a9a8fc09467f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjc4NDc4MDgsIm5iZiI6MTcyNzg0NzUwOCwicGF0aCI6Ii80MjA4Mzg0Ni8zNzAzMDg0ODktMWJmOWI0MjctMGRhZi00YjY5LTliNDUtYTlhOGZjMDk0NjdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDAyVDA1MzgyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5NWEyNTJhY2MzYzQxN2NmZWM1Yjc4NTZhNGYzYmViNmNjMDEzMmUzYmE1MTk4OTZlNDZlM2IyZWMzYmUzODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8WVQcF1h41-gYzy3FdeX6E0F7MrcEfJM8EcTR6cWbLk"><img src="https://private-user-images.githubusercontent.com/42083846/370308489-1bf9b427-0daf-4b69-9b45-a9a8fc09467f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjc4NDc4MDgsIm5iZiI6MTcyNzg0NzUwOCwicGF0aCI6Ii80MjA4Mzg0Ni8zNzAzMDg0ODktMWJmOWI0MjctMGRhZi00YjY5LTliNDUtYTlhOGZjMDk0NjdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDAyVDA1MzgyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5NWEyNTJhY2MzYzQxN2NmZWM1Yjc4NTZhNGYzYmViNmNjMDEzMmUzYmE1MTk4OTZlNDZlM2IyZWMzYmUzODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8WVQcF1h41-gYzy3FdeX6E0F7MrcEfJM8EcTR6cWbLk"></a>
</article></div>
SOURCE;
Expand Down Expand Up @@ -320,7 +321,8 @@ public function testReadmeParsing(): void
<h2 class="heading-element">Community</h2><a id="user-content-community" class="anchor" href="#user-content-community" rel="nofollow noindex noopener external ugc"></a>
<p><a href="https://fork-cms.herokuapp.com" rel="nofollow noindex noopener external ugc"><img src="https://camo.githubusercontent.com/f21b09fbe2280a6ee4a1badd19dd95404a233c132c021239d80d07a5e44bc8ec/68747470733a2f2f696d6775722e636f6d2f7a5875765264772e706e67" alt="Join our Slack channel" /> Join our Slack Channel!</a></p>
<p><em>The Fork CMS team</em></p>
<img src="https://user-images.githubusercontent.com/abcdef" />
<img src="https://private-user-images.githubusercontent.com/abcdef" />
<a href="https://github.com/user-attachments/assets/1bf9b427-0daf-4b69-9b45-a9a8fc09467f" rel="nofollow noindex noopener external ugc"><img src="https://github.com/user-attachments/assets/1bf9b427-0daf-4b69-9b45-a9a8fc09467f" /></a>


EXPECTED
Expand Down

0 comments on commit 1f080cd

Please sign in to comment.