From 8b7cdb7fb417f349eab04335d0a7bc3956343a81 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 31 Jan 2014 16:42:49 +0000 Subject: [PATCH] Treat HTTP header as case insensitive --- src/Composer/Util/GitHub.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/GitHub.php b/src/Composer/Util/GitHub.php index 40060395f..942e7749c 100644 --- a/src/Composer/Util/GitHub.php +++ b/src/Composer/Util/GitHub.php @@ -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)));