Closed Bug 2070607 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62515 - OOR-CORS: Avoid CorsURLLoader restart on redirect

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62515 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62515
Details from upstream follow.

Takashi Toyoshima <toyoshim@chromium.org> wrote:

OOR-CORS: Avoid CorsURLLoader restart on redirect

CorsURLLoader previously restarted requests from scratch via
StartRequest() on redirects requiring CORS or preflights. This destroyed
the underlying URLRequest redirect history, causing Fetch Metadata
headers (e.g. Sec-Fetch-Site) to be incorrectly computed.

This CL introduces base::Feature kAvoidCorsURLLoaderRestartOnRedirect
(enabled by default) to handle redirects in-place via
network_loader_->FollowRedirect() and update headers directly. If a
redirect requires a CORS preflight, CorsURLLoader runs the preflight
asynchronously without tearing down the active loader.

Key changes:

  • In-place redirect and preflight handling in CorsURLLoader under
    kAvoidCorsURLLoaderRestartOnRedirect.
  • Strict validation of redirected URLs and origin permissions via
    OriginAccessList for credentials and client certificates.
  • WHATWG Fetch compliant credential handling across cross-origin
    redirects.
  • Parameterized test coverage for both in-place and legacy restart
    paths.

Bug: 513518289
Change-Id: Ic250535f64bf316df656d6cbe29e27cdbac7272a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8278433
Reviewed-by: Kenichi Ishibashi \<bashi@chromium.org>
Commit-Queue: Takashi Toyoshima \<toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1693621}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 38 tests and 3 subtests

Status Summary

Firefox

OK : 33[Gecko-linux2404-64-debug] 34[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 167
TIMEOUT: 2

Chrome

OK : 1
PASS : 1

Safari

TIMEOUT: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.