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(ClientRequest): do not unshift write buffer when flushing request headers #674

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented Nov 6, 2024

Changes

Removes this.writeBuffer.unshift() when flushing request write buffer on the first read() of the request body stream. This will preserve the first chunk to be sent to the original server in case of passthrough.

The fix itself is to call all the write callbacks in order but preserve this.writeBuffer so it's forwarded in its entirety over the original socket.

@kettanaito kettanaito marked this pull request as draft November 6, 2024 12:01
@kettanaito kettanaito self-assigned this Nov 6, 2024
@kettanaito kettanaito marked this pull request as ready for review November 6, 2024 12:55
@kettanaito kettanaito merged commit 0d580b3 into main Nov 6, 2024
2 checks passed
@kettanaito kettanaito deleted the fix/passthrough-missing-first-byte branch November 6, 2024 12:55
@kettanaito
Copy link
Member Author

Released: v0.36.10 🎉

This has been released in v0.36.10!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

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