From 360df90ba59a29c1ad03c75370a46327441a5664 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 10 Jan 2014 16:07:26 +0000 Subject: [PATCH] Add GitHub OTP to request headers --- src/Composer/Util/RemoteFilesystem.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 158ff8034..26b2774c9 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/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")); }