Skip to content

Conversation

pyneda
Copy link

@pyneda pyneda commented Oct 19, 2024

Fix for the following error

(http2: Transport: cannot retry err [stream error: stream ID 1; PROTOCOL_ERROR; received from peer] after Request.Body was written; define Request.GetBody to avoid this error)

Copy link
Member

@ysmood ysmood left a comment

Choose a reason for hiding this comment

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

Could you add at least a test for it?

@pyneda
Copy link
Author

pyneda commented Oct 21, 2024

Could you add at least a test for it?

Attempted to set up a test case using an HTTP/2 test server and a client that forces retries to reproduce the original issue. However, I wasn't able to replicate the same error within a test case.

As a fallback, added a simpler test that ensures the request body is correctly propagated through redirects and verifies that the GetBody function added in LoadResponse behaves as expected.

Some related issues:
stripe/stripe-go#710
connectrpc/connect-go#541

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