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

fix: add accept header when using json payload #30

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Conversation

Atinux
Copy link
Member

@Atinux Atinux commented Nov 22, 2021

Some API (like https://github.com/login/oauth/access_token) needs POST and expect an Accept: application/json header to return json.

See https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github

When no using the Accept headers, it sends back:

error=bad_verification_code&error_description=The+code+passed+is+incorrect+or+expired.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-oauth-app-access-token-request-errors%2F%23bad-verification-code

@pi0 pi0 merged commit 662145f into main Nov 22, 2021
@pi0 pi0 deleted the fix/accept-header branch November 22, 2021 23:38
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.

None yet

2 participants