Skip to content

Commit

Permalink
add url to shouldSkip check, only include http/https URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Sep 20, 2023
1 parent 9f43f3c commit a2b4f8b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions util/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class Recorder
}

handleRequestExtraInfo(params) {
if (!this.shouldSkip(null, params.headers, null)) {
if (!this.shouldSkip(params.headers)) {
const reqresp = this.pendingReqResp(params.requestId, true);
if (reqresp) {
reqresp.fillRequestExtraInfo(params);
Expand Down Expand Up @@ -247,7 +247,7 @@ export class Recorder
let continued = false;

try {
if (responseStatusCode && !responseErrorReason && !this.shouldSkip(method, headers, resourceType) && !(isSWorker && networkId)) {
if (responseStatusCode && !responseErrorReason && !this.shouldSkip(headers, url, method, resourceType) && !(isSWorker && networkId)) {
continued = await this.handleFetchResponse(params, cdp, isSWorker);
}
} catch (e) {
Expand Down Expand Up @@ -434,11 +434,15 @@ export class Recorder
await this.writer.flush();
}

shouldSkip(method, headers, resourceType) {
shouldSkip(headers, url, method, resourceType) {
if (headers && !method) {
method = headers[":method"];
}

if (!this.isValidUrl(url)) {
return true;
}

if (method === "OPTIONS" || method === "HEAD") {
return true;
}
Expand Down Expand Up @@ -669,6 +673,7 @@ class AsyncFetcher

if (buffers && buffers.length && !fh) {
reqresp.payload = Buffer.concat(buffers, currSize);
externalBuffer.buffers = [reqresp.payload];
}
}

Expand Down

0 comments on commit a2b4f8b

Please sign in to comment.