Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 946a6c01843cc7da0b446fffbae6c9b1c152a303
https://github.com/WebKit/WebKit/commit/946a6c01843cc7da0b446fffbae6c9b1c152a303
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-04 (Fri, 04 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.js
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.serviceworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.sharedworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.worker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.js
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.serviceworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.sharedworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.worker-expected.txt
M Source/WebCore/Modules/cache/DOMCache.cpp
Log Message:
-----------
Cache.delete() and Cache.keys() swallow exceptions thrown while constructing
a Request from a URL string
https://bugs.webkit.org/show_bug.cgi?id=323401
rdar://186636105
Reviewed by Youenn Fablet.
DOMCache::remove() and DOMCache::keys() called requestFromInfo() without the
requestValidationFailed out-parameter and resolved the promise with an empty
result (false / an empty array) on any exception. As a result a genuine
TypeError thrown while constructing the Request from a string — e.g. a URL
that is invalid or contains credentials — was silently turned into an empty
resolve instead of rejecting the promise.
The Cache specification requires the exception to propagate. For
Cache.delete() [1]:
"Else if request is a string, then:
Set r to the associated request of the result of invoking the initial
value of Request as constructor with request as its argument. If this
throws an exception, return a promise rejected with that exception."
and identically for Cache.keys() [2]:
"Else if request is a string, then:
Set r to the associated request of the result of invoking the initial
value of Request as constructor with request as its argument. If this
throws an exception, return a promise rejected with that exception."
Only a Request object whose method is not `GET` (without ignoreMethod) resolves
with an empty result. doMatch() and matchAll() already distinguish these two
cases via the requestValidationFailed bool; make remove() and keys() do the
same. Chrome and Firefox already reject in this case.
[1] https://w3c.github.io/ServiceWorker/#cache-delete
[2] https://w3c.github.io/ServiceWorker/#cache-keys
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.js:
(cache_test):
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.serviceworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.sharedworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-delete.https.any.worker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.js:
(cache_test):
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.serviceworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.sharedworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/cache-keys.https.any.worker-expected.txt:
* Source/WebCore/Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::remove):
(WebCore::DOMCache::keys):
Canonical link: https://commits.webkit.org/320524@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications