Skip to content

Commit

Permalink
Bitbucket: handle missing authentication response from API returning …
Browse files Browse the repository at this point in the history
…404 status code
  • Loading branch information
glaubinix committed Mar 24, 2022
1 parent 44c1ff7 commit 6303ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Repository/Vcs/GitBitbucketDriver.php
Expand Up @@ -390,7 +390,7 @@ protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false)
} catch (TransportException $e) {
$bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->httpDownloader);

if (403 === $e->getCode() || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) {
if (in_array($e->getCode(), [403, 404], true) || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) {
if (!$this->io->hasAuthentication($this->originUrl)
&& $bitbucketUtil->authorizeOAuth($this->originUrl)
) {
Expand Down

0 comments on commit 6303ba6

Please sign in to comment.