options is optional
This commit is contained in:
parent
50e6658e71
commit
e971f39816
|
|
@ -64,7 +64,7 @@ export class TestProxy {
|
||||||
this.requestUrls.push(req.url);
|
this.requestUrls.push(req.url);
|
||||||
const url = new URL(req.url, `http://${req.headers.host}`);
|
const url = new URL(req.url, `http://${req.headers.host}`);
|
||||||
url.port = '' + port;
|
url.port = '' + port;
|
||||||
if (options.prefix)
|
if (options?.prefix)
|
||||||
url.pathname = url.pathname.replace(options.prefix, '');
|
url.pathname = url.pathname.replace(options.prefix, '');
|
||||||
req.url = url.toString();
|
req.url = url.toString();
|
||||||
});
|
});
|
||||||
|
|
@ -80,7 +80,7 @@ export class TestProxy {
|
||||||
this.wsUrls.push(req.url);
|
this.wsUrls.push(req.url);
|
||||||
const url = new URL(req.url, `http://${req.headers.host}`);
|
const url = new URL(req.url, `http://${req.headers.host}`);
|
||||||
url.port = '' + port;
|
url.port = '' + port;
|
||||||
if (options.prefix)
|
if (options?.prefix)
|
||||||
url.pathname = url.pathname.replace(options.prefix, '');
|
url.pathname = url.pathname.replace(options.prefix, '');
|
||||||
req.url = url.toString();
|
req.url = url.toString();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue