Skip to content

fix(e2e): bypass Fastly CAPTCHA on FxA stage with fxa-ci header#6621

Merged
EMMLynch merged 1 commit into
mainfrom
fix-e2e-fxa-ci
May 5, 2026
Merged

fix(e2e): bypass Fastly CAPTCHA on FxA stage with fxa-ci header#6621
EMMLynch merged 1 commit into
mainfrom
fix-e2e-fxa-ci

Conversation

@groovecoder

@groovecoder groovecoder commented May 4, 2026

Copy link
Copy Markdown
Member

References:

Jira: https://mozilla-hub.atlassian.net/browse/MNTOR-5273

Description

Fastly's dynamic CAPTCHA blocks headless Chromium on FxA stage. The fxa-ci header bypasses it, but Playwright's extraHTTPHeaders sends it on all requests. Third-party domains reject the custom header in CORS preflight, breaking the OAuth flow.

Send fxa-ci globally via extraHTTPHeaders, then strip it from non-FxA domains with page.route() handlers.

Screenshot (if applicable)

image

How to test

https://github.com/mozilla/blurts-server/actions/runs/25343631607

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, I've checked that it still works with the flag both on, and with the flag off.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

Fastly's dynamic CAPTCHA blocks headless Chromium on FxA stage.
The fxa-ci header bypasses it, but Playwright's extraHTTPHeaders
sends it on all requests. Third-party domains reject the custom
header in CORS preflight, breaking the OAuth flow.

Send fxa-ci globally via extraHTTPHeaders, then strip it from
non-FxA domains with page.route() handlers.
@groovecoder groovecoder marked this pull request as ready for review May 4, 2026 21:32
@EMMLynch EMMLynch self-requested a review May 5, 2026 14:17

@EMMLynch EMMLynch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. This matches the changes made for Relay

@EMMLynch EMMLynch added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit 98b6350 May 5, 2026
20 of 21 checks passed
@EMMLynch EMMLynch deleted the fix-e2e-fxa-ci branch May 5, 2026 14:40
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