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 (#10657)
  • Loading branch information
glaubinix committed Mar 29, 2022
1 parent 44c1ff7 commit eb0aaa7
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(), array(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 eb0aaa7

Please sign in to comment.