We should use "error" redirect mode for fetching service worker scripts, as per: - https://w3c.github.io/ServiceWorker/#update (Step 7.5)
Created attachment 329689 [details] Patch
Created attachment 329694 [details] Patch
Comment on attachment 329694 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329694&action=review > LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:6 > +FAIL Registering redirected script assert_throws: Registration of redirected script should fail. function "function () { throw e }" threw object "TypeError: Script URL https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=%2Fresources%2Fregistration-worker.js fetch resulted in error: Redirections are not allowed" that is not a DOMException SecurityError: property "code" is equal to undefined, expected 18 It does not seem there is any change of behavior, except for the message to be more precise. Maybe this test was throwing for a different reason?
Comment on attachment 329694 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329694&action=review >> LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:6 >> +FAIL Registering redirected script assert_throws: Registration of redirected script should fail. function "function () { throw e }" threw object "TypeError: Script URL https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=%2Fresources%2Fregistration-worker.js fetch resulted in error: Redirections are not allowed" that is not a DOMException SecurityError: property "code" is equal to undefined, expected 18 > > It does not seem there is any change of behavior, except for the message to be more precise. > Maybe this test was throwing for a different reason? Yep, the test is bad and attempt to redirect to an invalid URL. I am about to submit a PR upstream.
(In reply to Chris Dumez from comment #4) > Comment on attachment 329694 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=329694&action=review > > >> LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:6 > >> +FAIL Registering redirected script assert_throws: Registration of redirected script should fail. function "function () { throw e }" threw object "TypeError: Script URL https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=%2Fresources%2Fregistration-worker.js fetch resulted in error: Redirections are not allowed" that is not a DOMException SecurityError: property "code" is equal to undefined, expected 18 > > > > It does not seem there is any change of behavior, except for the message to be more precise. > > Maybe this test was throwing for a different reason? > > Yep, the test is bad and attempt to redirect to an invalid URL. I am about > to submit a PR upstream. -> https://github.com/w3c/web-platform-tests/pull/8733
Created attachment 329700 [details] Patch
Comment on attachment 329700 [details] Patch Clearing flags on attachment: 329700 Committed r226087: <https://trac.webkit.org/changeset/226087>
All reviewed patches have been landed. Closing bug.
<rdar://problem/36120116>