Add OTP token to the request headers
parent
7e0d8c1bc5
commit
cedae88b67
|
@ -101,11 +101,17 @@ class GitHub
|
||||||
$appName .= ' on ' . trim($output);
|
$appName .= ' on ' . trim($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$headers = array('Content-Type: application/json');
|
||||||
|
|
||||||
|
if ($otp) {
|
||||||
|
$headers[] = 'X-GitHub-OTP: ' . $otp;
|
||||||
|
}
|
||||||
|
|
||||||
$contents = JsonFile::parseJson($this->remoteFilesystem->getContents($originUrl, 'https://'. $apiUrl . '/authorizations', false, array(
|
$contents = JsonFile::parseJson($this->remoteFilesystem->getContents($originUrl, 'https://'. $apiUrl . '/authorizations', false, array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'follow_location' => false,
|
'follow_location' => false,
|
||||||
'header' => "Content-Type: application/json\r\n",
|
'header' => $headers,
|
||||||
'content' => json_encode(array(
|
'content' => json_encode(array(
|
||||||
'scopes' => array('repo'),
|
'scopes' => array('repo'),
|
||||||
'note' => $appName,
|
'note' => $appName,
|
||||||
|
|
Loading…
Reference in New Issue