Skip to content

Whitelist a request #1231

Answered by kettanaito
rosshulford asked this question in Q&A
May 11, 2022 · 3 comments · 12 replies
Discussion options

You must be logged in to vote

Hey, @rosshulford.

Passthrough by default

MSW only captures those requests which you describe in your request handlers. All other requests won't be affected and will be performed as-is.

In the browser, all requests will go through the Service Worker regardless if they should be mocked or not. This is an implementation detail of the library and should not affect you in any way (the original responses will be returned in case a request doesn't have a corresponding request handler on your side).

Whitelist for onUnhandledRequest

By default, MSW will try to warn you when a passthrough request happens. This is an optimal DX in regards to people forgetting to mock requests or making typos in the…

Replies: 3 comments 12 replies

Comment options

You must be logged in to vote
6 replies
@cmacdonnacha
Comment options

@kettanaito
Comment options

@cmacdonnacha
Comment options

@kettanaito
Comment options

@nicholaspretorius
Comment options

Answer selected by kettanaito
Comment options

You must be logged in to vote
2 replies
@Dmo16
Comment options

@kettanaito
Comment options

Comment options

You must be logged in to vote
4 replies
@kettanaito
Comment options

@timsofteng
Comment options

@timsofteng
Comment options

@kettanaito
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #1230 on May 11, 2022 12:42.