Handle the intercepted request by performing it as-is.

Call signature

function passthrough(): Response {}


Source code for the `passthrough` namespace.


import { http, passthrough, HttpResponse } from 'msw'
export const handlers = [
  http.get('/resource', ({ request }) => {
    if (request.headers.has('x-my-header')) {
      return passthrough()
    return HttpResponse.text('Mocked response')

Unlike bypass(), the passthrough() function does not result in an additional request, and is designed to explicitly pass through an intercepted request within the response resolver. Because of this, the passthrough() function cannot be used to perform an additional request, only to handle an already intercepted one.


Perform an additional request outside of the interception algorithm.