Commit d6981b3
xueyuan
fix(auth): add Accept header to token and refresh requests
OAuthClientProvider._build_token_request and _refresh_token did not
include an Accept header, so servers that default to form-encoded
responses (e.g. GitHub's OAuth token endpoint) would not return JSON.
This caused token exchange to fail with a parse error.
Added Accept: application/json to both token exchange and refresh
requests so servers know to respond with JSON.1 parent 3eb5799 commit d6981b3
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
| |||
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| 600 | + | |
600 | 601 | | |
601 | 602 | | |
602 | 603 | | |
| |||
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| 627 | + | |
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
| |||
0 commit comments