allow callback to look at response body even when HTTP status code indicates failure #15532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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]