Skip to content

Commit 44ab61c

Browse files
committed
Merge - Add missing change
1 parent 4d8a411 commit 44ab61c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/AbstractGithubObject.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,14 @@ protected function fetchUrl($path, $page = 0, $limit = 0)
115115

116116
if ($this->options->get('gh.token', false))
117117
{
118-
// Use oAuth authentication - @todo set in request header ?
119-
$uri->setVar('access_token', $this->options->get('gh.token'));
118+
// Use oAuth authentication
119+
$headers = $this->client->getOption('headers', array());
120+
121+
if (!isset($headers['Authorization']))
122+
{
123+
$headers['Authorization'] = 'token ' . $this->options->get('gh.token');
124+
$this->client->setOption('headers', $headers);
125+
}
120126
}
121127
else
122128
{

0 commit comments

Comments
 (0)