Skip to content

Conversation

@Enet4
Copy link
Contributor

@Enet4 Enet4 commented Nov 15, 2025

Make toPublicUrl more consistent among environments and prevent onUnhandledRequest from presenting a duplicated query string.

Also add node env test suites for toPublicUrl and onUnhandledRequest.

Refs: #2628


Addendum: there was a suggestion to change the behavior of toPublicUrl so that it would include the search parameters everywhere, but this would have led to the breaking of multiple other assumptions from callers of toPublicUrl, so this seemed to me like a reasonable path with much less friction.

Make `toPublicUrl` more consistent among environments
and prevent `onUnhandledRequest` from presenting a duplicated query string

Also add node env test suites for `toPublicUrl` and `onUnhandledRequest`

Refs: mswjs#2628
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/msw@2629

commit: 0a704d7

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.

Looks good to me! Thanks, @Enet4.

@kettanaito kettanaito changed the title fix: remove search params in output of toPublicUrl in node environments fix(toPublicUrl): remove search parameters in Node.js Nov 23, 2025
@kettanaito kettanaito merged commit 18d7d3d into mswjs:main Nov 23, 2025
20 of 21 checks passed
@kettanaito
Copy link
Member

Released: v2.12.3 🎉

This has been released in v2.12.3.

Get these changes by running the following command:

npm i msw@latest

Predictable release automation by Release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants