refactor
This commit is contained in:
parent
662d3b2ef0
commit
4d4ca68b70
|
|
@ -30,9 +30,11 @@ export class MockingProxy extends ChannelOwner<channels.MockingProxyChannel> {
|
|||
const requestContext = APIRequestContext.from(initializer.requestContext);
|
||||
|
||||
this._channel.on('route', async (params: channels.MockingProxyRouteEvent) => {
|
||||
const browserRequest = params.correlation ? this._browserRequests.get(params.correlation) : undefined;
|
||||
if (params.correlation)
|
||||
let browserRequest: network.Request | undefined;
|
||||
if (params.correlation) {
|
||||
browserRequest = this._browserRequests.get(params.correlation);
|
||||
this._browserRequests.delete(params.correlation);
|
||||
}
|
||||
const route = network.Route.from(params.route);
|
||||
route._context = requestContext;
|
||||
this.emit(Events.MockingProxy.Route, { route, browserRequest });
|
||||
|
|
|
|||
Loading…
Reference in a new issue