1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

fix gitlab not telling visibilty if user is not logged in

This commit is contained in:
Mikk Tendermann 2017-08-31 20:14:41 +03:00 committed by Jordi Boggiano
parent 37addea447
commit 2a89d37651
2 changed files with 44 additions and 1 deletions

View file

@ -308,7 +308,12 @@ class GitLabDriver extends VcsDriver
// we need to fetch the default branch from the api
$resource = $this->getApiUrl();
$this->project = JsonFile::parseJson($this->getContents($resource, true), $resource);
$this->isPrivate = $this->project['visibility'] !== 'public';
if (isset($this->project['visibility'])) {
$this->isPrivate = $this->project['visibility'] !== 'public';
} else {
// client is not authendicated, therefore repository has to be public
$this->isPrivate = false;
}
}
protected function attemptCloneFallback()