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(); });