Commit 8c1f757
Soham Dahivalkar
fix(auth): add Accept: application/json header to OAuth token requests
Token exchange and refresh requests only set Content-Type but omit the
Accept header. Some OAuth providers (e.g. GitHub) return form-encoded
data by default and require Accept: application/json to return JSON.
Since _handle_token_response parses the body as JSON, omitting the
Accept header causes parse failures with these providers.
Add Accept: application/json to both _exchange_token_authorization_code
and _build_refresh_token_request.
Fixes #15231 parent 616476f commit 8c1f757
1 file changed
Lines changed: 8 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 | | |
| |||
0 commit comments