We should use "error" redirect mode for fetching service worker scripts
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Dec 2017 00:48:06 +0000 (00:48 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Dec 2017 00:48:06 +0000 (00:48 +0000)
commitac76b420436eb331a29f0b1884e5c71820a3478d
treee40fa737058270891ca18450811360c262686e65
parent550b3834e266280160f77d7ed501cefd6ac6b84e
We should use "error" redirect mode for fetching service worker scripts
https://bugs.webkit.org/show_bug.cgi?id=180950

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline test now that behavior has changed. Note that we are still failing becuase we reject
the registration promise with a TypeError instead of a SecurityError. I cannot find any reason
to throw a SecurityError here based on the specification though, so the test may not match the
specification.

* web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:

Source/WebCore:

We should use "error" redirect mode for fetching service worker scripts, as per:
- https://w3c.github.io/ServiceWorker/#update (Step 7.5)

No new tests, rebaselined existing test.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* workers/Worker.cpp:
(WebCore::Worker::create):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/TestExpectations
LayoutTests/http/tests/fetch/redirectmode-and-preload-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-security-error.js
Source/WebCore/ChangeLog
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/workers/WorkerScriptLoader.h
Source/WebCore/workers/service/ServiceWorkerJob.cpp