Skip to content

Commit

Permalink
chore: add more
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Mar 11, 2024
1 parent e6011d4 commit e59786c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/bidiMapper/domains/network/NetworkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export class NetworkProcessor {
cdpFetchHeadersFromBidiNetworkHeaders(headers);

if (params.credentials) {
// ; Step 11. credentials
const request = this.#getBlockedRequestOrFail(networkId, [
Network.InterceptPhase.AuthRequired,
]);
Expand Down Expand Up @@ -213,12 +212,23 @@ export class NetworkProcessor {

// TODO: Set / expand.
// ; Step 10. cookies
// ; Step 11. credentials
const request = this.#getBlockedRequestOrFail(networkId, [
Network.InterceptPhase.BeforeRequestSent,
Network.InterceptPhase.ResponseStarted,
Network.InterceptPhase.AuthRequired,
]);

if (request.currentInterceptPhase === Network.InterceptPhase.AuthRequired) {
// TODO: Verify this is the correct behavior and we can replace the
// response in the next event
await Promise.all([
request.waitResponseBlocked,
request.continueWithAuth({
response: 'CancelAuth',
}),
]);
}

await request.provideResponse({
responseCode: statusCode ?? request.statusCode,
responsePhrase: reasonPhrase,
Expand Down

0 comments on commit e59786c

Please sign in to comment.