Closed Bug 2079471 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63356 - Address various Background Fetch CORS issues

Categories

(Core :: DOM: Service Workers, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Hubert Chao <hchao@chromium.org> wrote:

Address various Background Fetch CORS issues

This CL expands test coverage and fixes lingering response type and
header exposure bugs resolved by moving Background Fetch away from
RequestMode::kNavigate to standard RequestMode::kCors enforcement, and
expands test coverage.

Specifically:

  • Fixes response type assignment in
    MarkRequestCompleteTask::StoreResponse by dynamically assigning
    FetchResponseType::kCors when the response URL origin differs from
    the registration's initiator origin (instead of hardcoding
    kDefault). This ensures JavaScript Response objects enforce
    strict CORS exposed-header filtering (Access-Control-Expose-Headers)
    and correctly mark response types as 'cors'.
  • Adds browser tests verifying CORS restrictions across redirect
    chains (FailsOnCrossOriginRedirectWithoutCorsHeaders,
    SucceedsOnCrossOriginRedirectWithCorsHeaders).
  • Adds browser tests verifying CORS OPTIONS preflight blocking on
    custom request headers (FailsWithCustomHeaderWithoutPreflight).
  • Adds browser tests verifying accurate credentials mode plumbing and
    wildcard origin constraints
    (FailsWithCredentialsIncludeAgainstWildcardOrigin,
    SucceedsWithCredentialsOmitAgainstWildcardOrigin).
  • Adds browser tests verifying JavaScript response record encapsulation
    (CrossOriginResponseTypeIsCors, NonCorsExposedHeaderNotExposed).
  • Introduces standardized Web Platform Test (WPT) suite under
    external/wpt/background-fetch/cors.https.window.js verifying
    interoperable CORS behaviors (preflights, response types, exposed
    headers, credentials).

TAG=agy
CONV=f978795a-c003-44c4-b9c9-28b4678a1f95

Fixed: 496008447, 495903812, 485855931, 40059500, 500171457, 498000798
Bug: 515243254
Change-Id: I1ab48bc2a63aaaf9bc2e9ea480f062428416ff61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8125729
Reviewed-by: Yoshisato Yanagisawa \<yyanagisawa@chromium.org>
Reviewed-by: Philip Rogers \<pdr@chromium.org>
Reviewed-by: Camille Lamy \<clamy@chromium.org>
Commit-Queue: Hubert Chao \<hchao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1713427}

Component: web-platform-tests → DOM: Service Workers
Product: Testing → Core

CI Results

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

Total 15 tests

Status Summary

Firefox

OK : 1
FAIL : 5

Chrome

FAIL : 1
TIMEOUT: 2
NOTRUN : 3

Safari

OK : 1
FAIL : 5

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: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.