[wpt-sync] Sync PR 63356 - Address various Background Fetch CORS issues
Categories
(Core :: DOM: Service Workers, task, P4)
Tracking
()
| 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-28b4678a1f95Fixed: 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}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=101889
| Assignee | ||
Comment 2•1 month ago
|
||
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
- /background-fetch/abort.https.window.html [wpt.fyi]:
SKIP - /background-fetch/content-security-policy.https.window.html [wpt.fyi]:
SKIP - /background-fetch/cors.https.window.html [wpt.fyi]:
OK[GitHub],SKIP[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-debug,Gecko-linux2404-64-opt,Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt] (Chrome:TIMEOUT, Safari:OK)- Cross-origin response type is cors and non-CORS-exposed headers are filtered:
FAIL(Chrome:FAIL, Safari:FAIL) - Cross-origin Background Fetch fails without CORS headers:
FAIL(Chrome:TIMEOUT, Safari:FAIL) - Cross-origin Background Fetch with custom headers fails without preflight approval:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Cross-origin Background Fetch with credentials mode include fails against wildcard Origin:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Cross-origin Background Fetch with credentials mode omit succeeds against wildcard Origin:
FAIL(Chrome:NOTRUN, Safari:FAIL)
- Cross-origin response type is cors and non-CORS-exposed headers are filtered:
- /background-fetch/fetch-uploads.https.window.html [wpt.fyi]:
SKIP - /background-fetch/fetch.https.window.html [wpt.fyi]:
SKIP - /background-fetch/get-ids.https.window.html [wpt.fyi]:
SKIP - /background-fetch/get.https.window.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.sharedworker.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.worker.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.serviceworker.html [wpt.fyi]:
SKIP - /background-fetch/match.https.window.html [wpt.fyi]:
SKIP - /background-fetch/mixed-content-and-allowed-schemes.https.window.html [wpt.fyi]:
SKIP - /background-fetch/port-blocking.https.window.html [wpt.fyi]:
SKIP - /background-fetch/update-ui.https.window.html [wpt.fyi]:
SKIP
Tests Disabled in Gecko Infrastructure
- /background-fetch/abort.https.window.html [wpt.fyi]:
SKIP - /background-fetch/content-security-policy.https.window.html [wpt.fyi]:
SKIP - /background-fetch/cors.https.window.html [wpt.fyi]:
OK[GitHub],SKIP[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-debug,Gecko-linux2404-64-opt,Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt] (Chrome:TIMEOUT, Safari:OK) - /background-fetch/fetch-uploads.https.window.html [wpt.fyi]:
SKIP - /background-fetch/fetch.https.window.html [wpt.fyi]:
SKIP - /background-fetch/get-ids.https.window.html [wpt.fyi]:
SKIP - /background-fetch/get.https.window.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.sharedworker.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.worker.html [wpt.fyi]:
SKIP - /background-fetch/idlharness.https.any.serviceworker.html [wpt.fyi]:
SKIP - /background-fetch/match.https.window.html [wpt.fyi]:
SKIP - /background-fetch/mixed-content-and-allowed-schemes.https.window.html [wpt.fyi]:
SKIP - /background-fetch/port-blocking.https.window.html [wpt.fyi]:
SKIP - /background-fetch/update-ui.https.window.html [wpt.fyi]:
SKIP
Comment 4•1 month ago
|
||
| bugherder | ||
Description
•