-
-
Notifications
You must be signed in to change notification settings - Fork 594
Closed
Description
The following code snippet is supposed to produce the pull reques diff. It used to work a while ago but now it doesnt.
$client = new Github\Client();
$client->authenticate(
'put-your-token-here',
null,
Github\Client::AUTH_URL_TOKEN
);
/** @var Github\Api\PullRequest $api */
$api = $client->api('pull_request');
$client->setHeaders(array(
sprintf(
'Accept: application/vnd.github.%s.diff',
$client->getOption('api_version')
)
));
$diff = $api->show('KnpLabs', 'php-github-api', '92');
echo gettype($diff);
// expected: string
// actual: arrayThe point is that here default Accept header is appepended with custom but not overridden, thus both of them are sent.
Default User-Agent and Accept headers should be sent only if other values are not specified.
Metadata
Metadata
Assignees
Labels
No labels