Skip to content

chore(bidi): handle CORS preflight requests#39213

Merged
yury-s merged 3 commits intomicrosoft:mainfrom
hbenl:handle-preflight-requests
Feb 12, 2026
Merged

chore(bidi): handle CORS preflight requests#39213
yury-s merged 3 commits intomicrosoft:mainfrom
hbenl:handle-preflight-requests

Conversation

@hbenl
Copy link
Collaborator

@hbenl hbenl commented Feb 10, 2026

Fixes the following tests in page/page-event-request.spec.ts:

  • "should not expose preflight OPTIONS request"
  • "should not expose preflight OPTIONS request with network interception"

@github-actions

This comment has been minimized.

@hbenl hbenl force-pushed the handle-preflight-requests branch from 62e506d to 439ac1c Compare February 10, 2026 16:01
@github-actions

This comment has been minimized.

@hbenl hbenl force-pushed the handle-preflight-requests branch from 439ac1c to 87fab46 Compare February 10, 2026 16:16
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.


// handle CORS preflight requests
if (param.request.method === 'OPTIONS') {
// TODO: we should detect preflight requests by looking at param.initiator.type, but the Bidi spec for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about other types, but marking preflight sounds non-controversial.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the condition to if (param.initiator?.type === 'preflight' || requestHeaders['access-control-request-method'])

hbenl and others added 2 commits February 11, 2026 08:59
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
Signed-off-by: Holger Benl <hbenl@evandor.de>
@github-actions
Copy link
Contributor

Test results for "tests 1"

4 failed
❌ [playwright-test] › playwright.trace.spec.ts:137 › should not throw with trace: on-first-retry and two retries in the same worker @macos-latest-node20
❌ [playwright-test] › reporter-junit.spec.ts:310 › created › should render existing attachments, but not missing ones @macos-latest-node20
❌ [playwright-test] › reporter-line.spec.ts:193 › merged › should show error context with relative path @macos-latest-node20
❌ [playwright-test] › reporter.spec.ts:251 › created › should not have internal error when steps are finished after timeout @macos-latest-node20

4 flaky ⚠️ [chromium-page] › page/page-request-continue.spec.ts:754 › propagate headers cross origin redirect after interception `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/popup.spec.ts:258 › should not throw when click closes popup `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/trace-viewer.spec.ts:1241 › should update highlight when typing locator `@firefox-ubuntu-22.04-node20`
⚠️ [webkit-page] › page/page-autowaiting-basic.spec.ts:79 › should await form-post on click `@webkit-ubuntu-22.04-node20`

38551 passed, 843 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/http.spec.ts:149 › http transport browser lifecycle (isolated, multiclient) @mcp-macos-15

4778 passed, 135 skipped


Merge workflow run.

@yury-s yury-s merged commit 7e2ddfe into microsoft:main Feb 12, 2026
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments