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: clone response early for response logging #1799

Merged

Conversation

kunmagg
Copy link
Contributor

@kunmagg kunmagg commented Oct 26, 2023

Since v2.0.0, we get the following error "TypeError Response.clone: Body has already been consumed." when logging responses.

This is because the response body has already been used. Instead create a responseCloneForLogs (like before).

Since v2.0.0, we get the following error "TypeError Response.clone: Body has already been consumed." when logging responses.

This is because the response body has already been used. Instead create a responseCloneForLogs (like before).
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

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

This is correct. Thanks for spotting this, @kunmagg! Looks like a rebase issue.

@kettanaito kettanaito changed the title fix: use responseClone in handleRequest logging fix: clone response early for response logging Oct 27, 2023
@kettanaito kettanaito merged commit 5c5470a into mswjs:main Oct 27, 2023
8 checks passed
@kettanaito
Copy link
Member

Released: v2.0.1 🎉

This has been released in v2.0.1!

Make sure to always update to the latest version (npm i msw@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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants