Skip to content

Commit

Permalink
fix: throw invalid argument fo header
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed May 27, 2024
1 parent a3f7826 commit b97a387
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/bidiMapper/modules/network/NetworkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,20 @@ export class NetworkProcessor {

// TODO: Set / expand.
// ; Step 9. cookies
await request.continueRequest({
url,
method,
headers,
postData: getCdpBodyFromBiDiBytesValue(body),
});
try {
await request.continueRequest({
url,
method,
headers,
postData: getCdpBodyFromBiDiBytesValue(body),
});
} catch (error) {
// https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/fetch_handler.cc;l=169
if (error instanceof Error && error.message.includes('Invalid header')) {
throw new InvalidArgumentException('Tried setting invalid header');
}
throw error;
}

return {};
}
Expand Down

0 comments on commit b97a387

Please sign in to comment.