From e971f39816a0dd933209d9203d98ae34b5a2f01a Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 26 Nov 2024 16:43:04 +0100 Subject: [PATCH] options is optional --- tests/config/proxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/config/proxy.ts b/tests/config/proxy.ts index b8cc73e567..5e6f78a5b8 100644 --- a/tests/config/proxy.ts +++ b/tests/config/proxy.ts @@ -64,7 +64,7 @@ export class TestProxy { this.requestUrls.push(req.url); const url = new URL(req.url, `http://${req.headers.host}`); url.port = '' + port; - if (options.prefix) + if (options?.prefix) url.pathname = url.pathname.replace(options.prefix, ''); req.url = url.toString(); }); @@ -80,7 +80,7 @@ export class TestProxy { this.wsUrls.push(req.url); const url = new URL(req.url, `http://${req.headers.host}`); url.port = '' + port; - if (options.prefix) + if (options?.prefix) url.pathname = url.pathname.replace(options.prefix, ''); req.url = url.toString(); });