-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
MSW node does not intercept if I set 'X-Request-Id' #1935
Comments
Hi @cythrawll do you still encounter this issue? |
@kkhanhluu I've had to roll back my 2.0 migration because of this bug. I've not heard any movement on this issue so I assume it's still an issue? Considering it took some effort in migration and our mocks have moved so much since then, I cannot test this issue at this time unless I see movement on the issue. It looks like the code still has the same header check. Is there a concern it might have been fixed? |
Thanks for reporting this, @cythrawll. The This is not a good solution. I've opened a task to replace it (mswjs/interceptors#378). |
I've merged a workaround that would prevent Interceptors from meddling with the user-defined |
Opened a fix for this in #2110. |
Released: v2.2.12 🎉This has been released in v2.2.12! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Prerequisites
Environment check
msw
versionNode.js version
v18.16.1
Reproduction repository
https://codesandbox.io/p/devbox/eager-kapitsa-s4cnj7
Reproduction steps
Current behavior
Calls with
X-Request-Id
header do not get intercepted. This worked in msw 1.x.https://github.com/mswjs/interceptors/blob/122a6533ce57d551dc3b59b3bb43a39026989b70/src/interceptors/ClientRequest/NodeClientRequest.ts#L193
Expected behavior
Calls with
X-Request-Id
should be intercepted.We use that header to pass the request id from the browser request back to the backend for logging purposes. So we would like to intercept those requests. This header is a commonly used header for logging purposes.
The text was updated successfully, but these errors were encountered: