From c83a59779ea2ff1ae3ad450df8cbbf36237756f0 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Wed, 7 Jun 2023 15:26:42 +0200 Subject: [PATCH] fix(fromTraffic): clean generated request url (#32) --- src/fromTraffic/fromTraffic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fromTraffic/fromTraffic.ts b/src/fromTraffic/fromTraffic.ts index c5f7dbb..48e9f5d 100644 --- a/src/fromTraffic/fromTraffic.ts +++ b/src/fromTraffic/fromTraffic.ts @@ -10,6 +10,7 @@ import { ResponseTransformer, ResponseComposition, DefaultBodyType, + cleanUrl, } from 'msw' import { decodeBase64String } from './utils/decodeBase64String' @@ -35,7 +36,7 @@ function toRequestHandler( const method = request.method.toLowerCase() as keyof typeof rest const transformers = toResponseTransformers(entry) - return rest[method](request.url, (_, response) => { + return rest[method](cleanUrl(request.url), (_, response) => { return produceResponse(response, transformers) }) }