Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionThrower: adjust rate limit detection #959

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

glaubinix
Copy link
Contributor

GitHub returns 0 values for API limit headers on GraphQL endpoints in cases where no authentication is provided or the authentication is invalid. Running the following code currently triggers an ApiLimitExceedException because of that. Even though the GitHub API returns a 401 status code with the message This endpoint requires you to be authenticated.

<?php
require 'vendor/autoload.php';

$client = new \Github\Client();
$client->graphql()->execute('query { viewer { organizations(last: 100) { nodes { name } } } }');

@naderman
Copy link
Contributor

Can we get this merged? It's a pretty clear bug and would be helpful to have this on the 2.x branch too.

@acrobat acrobat changed the base branch from master to 2.x March 11, 2021 20:06
@acrobat acrobat merged commit 89f1639 into KnpLabs:2.x Mar 11, 2021
@acrobat
Copy link
Collaborator

acrobat commented Mar 11, 2021

Sorry for the delay! Thanks @glaubinix!

@acrobat
Copy link
Collaborator

acrobat commented Mar 11, 2021

Both 2.19.1 and 3.1.0 were released, containing this fix!

@glaubinix
Copy link
Contributor Author

No worries. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants