浏览代码

Treat HTTP header as case insensitive

Chris Smith 11 年之前
父节点
当前提交
8b7cdb7fb4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Util/GitHub.php

+ 2 - 2
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)));