Conversation
A 205 must not return any content, so DoWithContext should handle this case and not fail when trying to parse the JSON. Ref: https://httpwg.org/specs/rfc9110.html#status.205
Similar to the check for 204.
|
Any updates on this? I think this is a clear fix and would love to see this in the lib, I have nightmares from 🙀 if err != nil && err.Error() != "unexpected end of JSON input" { |
Member
|
Hey @nobe4, @babakks and are looking at this issue/PR and agree with this approach. I'm wondering if there was something that was on your mind in particular about what might need to be polished up more? It seems like you're following convention here, and it might be good as-is. I know that this was some time ago 🙏 so if this isn't relevant any longer, I understand. Looking to see if we couldn't land this in a |
Contributor
Author
|
Hi @BagToad 👋 I honestly don't recall what might have been improved 😬 Thanks 🙏 |
babakks
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As discussed in #161, this might be one other fix for supporting empty bodies from the server.
The test is a POC, and should probably be refactored into something better.