1
0
Fork 0

Treat HTTP header as case insensitive

pull/2577/head
Chris Smith 2014-01-31 16:42:49 +00:00
parent 78568b49d6
commit 8b7cdb7fb4
1 changed files with 2 additions and 2 deletions

View File

@ -125,10 +125,10 @@ class GitHub
// 401 when authentication was supplied, handle 2FA if required.
if ($this->io->hasAuthentication($originUrl)) {
$headerNames = array_map(function($header) {
return strstr($header, ':', true);
return strtolower(strstr($header, ':', true));
}, $e->getHeaders());
if ($key = array_search('X-GitHub-OTP', $headerNames)) {
if ($key = array_search('x-github-otp', $headerNames)) {
$headers = $e->getHeaders();
list($required, $method) = array_map('trim', explode(';', substr(strstr($headers[$key], ':'), 1)));