Commit 89f1639
authored
bug #959 ExceptionThrower: adjust rate limit detection (glaubinix)
This PR was merged into the 2.x branch.
Discussion
----------
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 } } } }');
```
Commits
-------
1a650c1 ExceptionThrower: adjust rate limit detectionFile tree
2 files changed
+20
-1
lines changed- lib/Github/HttpClient/Plugin
- test/Github/Tests/HttpClient/Plugin
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
180 | 199 | | |
181 | 200 | | |
182 | 201 | | |
0 commit comments