function GitHub::getSsoUrl
Extract SSO URL from response.
Parameters
string[] $headers Headers from Composer\Downloader\TransportException.:
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ GitHub.php, line 188
Class
- GitHub
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\UtilCode
public function getSsoUrl(array $headers) : ?string {
foreach ($headers as $header) {
$header = trim($header);
if (false === stripos($header, 'x-github-sso: required')) {
continue;
}
if (Preg::isMatch('{\\burl=(?P<url>[^\\s;]+)}', $header, $match)) {
return $match['url'];
}
}
return null;
}