From 468aa2f44e2110dd18c93627d057af207e5de0a4 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Wed, 6 Nov 2024 15:57:22 +0100 Subject: [PATCH] fix: filter handlers in fallback request listener --- src/browser/setupWorker/start/createFallbackRequestListener.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/browser/setupWorker/start/createFallbackRequestListener.ts b/src/browser/setupWorker/start/createFallbackRequestListener.ts index a87e5da81..733317e09 100644 --- a/src/browser/setupWorker/start/createFallbackRequestListener.ts +++ b/src/browser/setupWorker/start/createFallbackRequestListener.ts @@ -8,6 +8,7 @@ import { XMLHttpRequestInterceptor } from '@mswjs/interceptors/XMLHttpRequest' import { SetupWorkerInternalContext, StartOptions } from '../glossary' import type { RequiredDeep } from '~/core/typeUtils' import { handleRequest } from '~/core/utils/handleRequest' +import { toRequestHandlersOnly } from '~/core/utils/internal/filterRequestHandlers' export function createFallbackRequestListener( context: SetupWorkerInternalContext, @@ -24,7 +25,7 @@ export function createFallbackRequestListener( const response = await handleRequest( request, requestId, - context.getRequestHandlers(), + context.getRequestHandlers().filter(toRequestHandlersOnly), options, context.emitter, {