Skip to content

Conversation

@nobe4
Copy link
Contributor

@nobe4 nobe4 commented May 19, 2024

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.

nobe4 added 2 commits May 19, 2024 21:26
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
@nobe4 nobe4 marked this pull request as draft May 19, 2024 19:28
@nobe4 nobe4 marked this pull request as ready for review May 20, 2024 12:10
@mxie mxie added the external pull request originating outside of the CLI core team label Mar 26, 2025
@joelazar
Copy link

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" {

@BagToad
Copy link
Member

BagToad commented Oct 29, 2025

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 go-gh release sometime soon!

@nobe4
Copy link
Contributor Author

nobe4 commented Oct 30, 2025

Hi @BagToad 👋

I honestly don't recall what might have been improved 😬
So if you think this PR is good as-is, feel free to move it forward :)

Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants