rename _request
This commit is contained in:
parent
a6bf1f4b29
commit
d6bc3cf3af
|
|
@ -198,7 +198,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onRoute(route: network.Route) {
|
async _onRoute(route: network.Route) {
|
||||||
route._request = this.request;
|
route._context = this.request;
|
||||||
const page = route.request()._safePage();
|
const page = route.request()._safePage();
|
||||||
const routeHandlers = this._routes.slice();
|
const routeHandlers = this._routes.slice();
|
||||||
for (const routeHandler of routeHandlers) {
|
for (const routeHandler of routeHandlers) {
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ export class MockingProxy extends ChannelOwner<channels.MockingProxyChannel> imp
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onRoute(route: network.Route) {
|
async _onRoute(route: network.Route) {
|
||||||
route._request = this._requestContext;
|
route._context = this._requestContext;
|
||||||
const routeHandlers = this._routes.slice();
|
const routeHandlers = this._routes.slice();
|
||||||
for (const routeHandler of routeHandlers) {
|
for (const routeHandler of routeHandlers) {
|
||||||
if (!routeHandler.matches(route.request().url()))
|
if (!routeHandler.matches(route.request().url()))
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,7 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
|
||||||
|
|
||||||
export class Route extends ChannelOwner<channels.RouteChannel> implements api.Route {
|
export class Route extends ChannelOwner<channels.RouteChannel> implements api.Route {
|
||||||
private _handlingPromise: ManualPromise<boolean> | null = null;
|
private _handlingPromise: ManualPromise<boolean> | null = null;
|
||||||
_request!: APIRequestContext;
|
_context!: APIRequestContext;
|
||||||
_didThrow: boolean = false;
|
_didThrow: boolean = false;
|
||||||
|
|
||||||
static from(route: channels.RouteChannel): Route {
|
static from(route: channels.RouteChannel): Route {
|
||||||
|
|
@ -339,7 +339,7 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
|
||||||
|
|
||||||
async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number } = {}): Promise<APIResponse> {
|
async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number } = {}): Promise<APIResponse> {
|
||||||
return await this._wrapApiCall(async () => {
|
return await this._wrapApiCall(async () => {
|
||||||
return await this._request._innerFetch({ request: this.request(), data: options.postData, ...options });
|
return await this._context._innerFetch({ request: this.request(), data: options.postData, ...options });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _onRoute(route: Route) {
|
private async _onRoute(route: Route) {
|
||||||
route._request = this.context().request;
|
route._context = this.context().request;
|
||||||
const routeHandlers = this._routes.slice();
|
const routeHandlers = this._routes.slice();
|
||||||
for (const routeHandler of routeHandlers) {
|
for (const routeHandler of routeHandlers) {
|
||||||
// If the page was closed we stall all requests right away.
|
// If the page was closed we stall all requests right away.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue