Skip to content

Commit 58b9835

Browse files
committed
If calling rate_limit resource does not throw an exception if there is less than 0 requests remaining (rate_limit is exempt from any api request limits)
1 parent 5c3bb69 commit 58b9835

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Github/HttpClient/Listener/ErrorListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public function postSend(RequestInterface $request, MessageInterface $response)
4343
/** @var $response \Github\HttpClient\Message\Response */
4444
if ($response->isClientError() || $response->isServerError()) {
4545
$remaining = $response->getHeader('X-RateLimit-Remaining');
46-
if (null !== $remaining && 1 > $remaining) {
46+
47+
if (null !== $remaining && 1 > $remaining && 'rate_limit' !== substr($request->getResource(), 1, 10)) {
4748
throw new ApiLimitExceedException($this->options['api_limit']);
4849
}
4950

0 commit comments

Comments
 (0)