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

allow callback to look at response body even when HTTP status code indicates failure #15532

Merged
merged 1 commit into from
Jul 29, 2023

Conversation

Jamiras
Copy link
Contributor

@Jamiras Jamiras commented Jul 29, 2023

Description

RetroAchievements is looking at returning HTTP status code 401 (unauthorized) in addition to the JSON message body on failed login. However, the existing logic in the http_task code ignores the message body if the HTTP status code is not 2xx, so a failed login reports "HTTP error code 401" instead of "Invalid User/Password combination."

This modifies the http_task code to also provide the message body to the callback for non-2xx HTTP status codes. It will be cleaned up normally by the cleanup handler.

This cannot change the behavior in older clients, so we will deprecate the existing API and provide a new login API that includes the HTTP status code as part of the response.

Related Issues

n/a

Related Pull Requests

n/a

Reviewers

[If possible @mention all the people that should review your pull request]

@LibretroAdmin LibretroAdmin merged commit e1c3663 into libretro:master Jul 29, 2023
22 checks passed
@Jamiras Jamiras deleted the http_err_response_body branch July 29, 2023 03:00
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.

2 participants