소스 검색

Add GitHub OTP to request headers

Chris Smith 11 년 전
부모
커밋
360df90ba5
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/Composer/Util/RemoteFilesystem.php

+ 7 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -378,6 +378,13 @@ class RemoteFilesystem
             }
         }
 
+        // Handle GitHub two factor tokens.
+        if (isset($options['github-otp'])) {
+            $headers[] = 'X-GitHub-OTP: ' . $options['github-otp'];
+
+            unset($options['github-otp']);
+        }
+
         if (isset($options['http']['header']) && !is_array($options['http']['header'])) {
             $options['http']['header'] = explode("\r\n", trim($options['http']['header'], "\r\n"));
         }