Add secure-http:false option to disable the https default of gitlab driver when using ssh urls, fixes #5254
parent
b9bd021516
commit
40df5dddee
|
@ -66,7 +66,8 @@ class GitLabDriver extends VcsDriver
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts information from the repository url.
|
* Extracts information from the repository url.
|
||||||
* SSH urls uses https by default.
|
*
|
||||||
|
* SSH urls use https by default. Set "secure-http": false on the repository config to use http instead.
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -76,7 +77,7 @@ class GitLabDriver extends VcsDriver
|
||||||
throw new \InvalidArgumentException('The URL provided is invalid. It must be the HTTP URL of a GitLab project.');
|
throw new \InvalidArgumentException('The URL provided is invalid. It must be the HTTP URL of a GitLab project.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->scheme = !empty($match['scheme']) ? $match['scheme'] : 'https';
|
$this->scheme = !empty($match['scheme']) ? $match['scheme'] : (isset($this->repoConfig['secure-http']) && $this->repoConfig['secure-http'] === false ? 'http' : 'https');
|
||||||
$this->originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
|
$this->originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
|
||||||
$this->owner = $match['owner'];
|
$this->owner = $match['owner'];
|
||||||
$this->repository = preg_replace('#(\.git)$#', '', $match['repo']);
|
$this->repository = preg_replace('#(\.git)$#', '', $match['repo']);
|
||||||
|
@ -359,7 +360,7 @@ class GitLabDriver extends VcsDriver
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scheme = !empty($match['scheme']) ? $match['scheme'] : 'https';
|
$scheme = !empty($match['scheme']) ? $match['scheme'] : null;
|
||||||
$originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
|
$originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
|
||||||
|
|
||||||
if (!in_array($originUrl, (array) $config->get('gitlab-domains'))) {
|
if (!in_array($originUrl, (array) $config->get('gitlab-domains'))) {
|
||||||
|
|
Loading…
Reference in New Issue