Prerequisites
Environment check
Node.js version
v20.11.0
Reproduction repository
Always specify repros. Don't follow my lead.
Reproduction steps
- Set up MSW in the browser.
- Configure the
onUnhandledRequest callback:
await worker.start({
onUnhandledRequest(request, print) {
console.log('URL:', request.url)
if (/\.(css|js|json|png|jpg|gif)$/.test(request.url)) {
return
}
print.warning()
},
})
- Make a request like
/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.
Prerequisites
Environment check
mswversionNode.js version
v20.11.0
Reproduction repository
Always specify repros. Don't follow my lead.
Reproduction steps
onUnhandledRequestcallback:/fo/bar/?t=123Current behavior
MSW prints a clean URL, making it hard to understand why my custom
onUnhandledRequestlogic is not matching this request:Expected behavior
MSW preserves the unhandled request URL as-is, which includes keeping its query parameters and fragments.