-
-
Notifications
You must be signed in to change notification settings - Fork 530
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(setupWorker): correctly delete internal accept
header on passthrough
#2375
fix(setupWorker): correctly delete internal accept
header on passthrough
#2375
Conversation
the function delete for Headers manage only one parameter. what we try to do there it's to remove accept when it's value is equal to msw/passthrough
Hi, @smouillour. Thanks for spotting this. That's a good catch. In Node.js, you can use Your proposal is okay if the To properly solve this, we need to parse the How does that sound? |
accept
header on passthrough
Hi @kettanaito, |
Previous fix remove the accept header if it was equal to msw/passthrough. Now we will check the content of it and remove the value msw/passthrough if it inside. if there is only this value the header accept is removed
This looks great, thank you! One thing remaining is to add a test for this since we didn't catch this before. Would you like to give it a try? If not that's okay, I can add a test when I have some time this/next week. |
I added tests. |
Thanks, @smouillour. We usually take a different approach to testing worker-related things, that being relying on e2d tests (build -> run in the browser). I've reverted your test and added the in-browser test instead. If you are curious, take a look to see the difference (mostly that it's implementation-agnostic now). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🚀
accept
header on passthroughaccept
header on passthrough
Welcome to contributors, @smouillour 👏 |
Released: v2.6.7 🎉This has been released in v2.6.7! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Oh my goodness, thank you for finding this! I've been trying to figure this one out for a few months now. We use testcontainers, and I think this logic was messing with a bunch of stuff I have to Our tests finally passed again! Thanks! |
sendBeacon()
requests #2353the function delete for Headers manage only one parameter.
what we try to do there it's to remove the value msw/passthrough to the header accept.
change will check content of accept and: