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: Only parse response body when a body is expected #185

Merged
merged 3 commits into from
Mar 16, 2024

Conversation

izaaz
Copy link
Collaborator

@izaaz izaaz commented Mar 15, 2024

Summary

This PR fixes two issues

  1. Allow empty response bodies for successful requests (feat(upload): Accept HTTP 200 responses with empty body #184)
  2. When the server returns a 503, the response body is not an HTML page and not a json object. So try parsing response and don't fail (Value <html> of type java.lang.String cannot be converted to JSONObject #163)

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Copy link
Contributor

@justin-fiedler justin-fiedler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @izaaz.

Lint is failing in CI. I have gotten in the habit of running ./gradlew ktlintCheck locally, not sure if there is a way to intergrate this lint style into the IDE(s)

@izaaz
Copy link
Collaborator Author

izaaz commented Mar 15, 2024

Looks good. Thanks @izaaz.

Lint is failing in CI. I have gotten in the habit of running ./gradlew ktlintCheck locally, not sure if there is a way to intergrate this lint style into the IDE(s)

Good to know! Thanks @justin-fiedler

@izaaz izaaz merged commit cfd3bb8 into main Mar 16, 2024
2 checks passed
@izaaz izaaz deleted the AMP-90268/empty_response_handling branch March 16, 2024 00:08
github-actions bot pushed a commit that referenced this pull request Mar 18, 2024
## [1.16.2](v1.16.1...v1.16.2) (2024-03-18)

### Bug Fixes

* Only parse response body when a body is expected ([#185](#185)) ([cfd3bb8](cfd3bb8))
Copy link

🎉 This PR is included in version 1.16.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants