Closed kettanaito closed 7 months ago
The fix would be right here:
The reason we use toPublicUrl()
here is to omit the document's origin and print a relative URL. There are two ways to fix this:
toPublicUrl
and rely on request.url
as-is.search
and fragment
from the original request.url
(we construct a URL instance out of it anyway). Hi, I made a change and raised the PR: https://github.com/mswjs/msw/pull/2128
This has been released in v2.2.14!
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.
Prerequisites
Environment check
msw
versionNode.js version
v20.11.0
Reproduction repository
Always specify repros. Don't follow my lead.
Reproduction steps
Configure the
onUnhandledRequest
callback:/fo/bar/?t=123
Current behavior
MSW prints a clean URL, making it hard to understand why my custom
onUnhandledRequest
logic is not matching this request:Expected behavior
MSW preserves the unhandled request URL as-is, which includes keeping its query parameters and fragments.