Title: [227626] trunk
Revision
227626
Author
[email protected]
Date
2018-01-25 13:27:32 -0800 (Thu, 25 Jan 2018)

Log Message

DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
https://bugs.webkit.org/show_bug.cgi?id=182137

Patch by Youenn Fablet <[email protected]> on 2018-01-25
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:

Source/WebCore:

Covered by rebased test.
In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (227625 => 227626)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-25 21:26:36 UTC (rev 227625)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-25 21:27:32 UTC (rev 227626)
@@ -1,5 +1,14 @@
 2018-01-25  Youenn Fablet  <[email protected]>
 
+        DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
+        https://bugs.webkit.org/show_bug.cgi?id=182137
+
+        Reviewed by Chris Dumez.
+
+        * web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:
+
+2018-01-25  Youenn Fablet  <[email protected]>
+
         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
         https://bugs.webkit.org/show_bug.cgi?id=182115
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt (227625 => 227626)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt	2018-01-25 21:26:36 UTC (rev 227625)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt	2018-01-25 21:27:32 UTC (rev 227626)
@@ -13,8 +13,8 @@
 PASS The SW must intercept the request of CORS-unsupported other origin XHR. 
 PASS The SW must intercept the request of CORS-supported other origin XHR. 
 PASS The SW must intercept only the first request of redirected XHR. 
-FAIL The SW must intercept only the first request for XHR which is redirected to CORS-unsupported other origin. assert_object_equals: unexpected property "1"
-FAIL The SW must intercept only the first request for XHR which is redirected to CORS-supported other origin. assert_object_equals: unexpected property "1"
+PASS The SW must intercept only the first request for XHR which is redirected to CORS-unsupported other origin. 
+PASS The SW must intercept only the first request for XHR which is redirected to CORS-supported other origin. 
 PASS The SW must intercept the request for image. 
 PASS The SW must intercept the request for other origin image. 
 PASS The SW must intercept the request for CORS-unsupported other origin image. 

Modified: trunk/Source/WebCore/ChangeLog (227625 => 227626)


--- trunk/Source/WebCore/ChangeLog	2018-01-25 21:26:36 UTC (rev 227625)
+++ trunk/Source/WebCore/ChangeLog	2018-01-25 21:27:32 UTC (rev 227626)
@@ -1,5 +1,18 @@
 2018-01-25  Youenn Fablet  <[email protected]>
 
+        DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
+        https://bugs.webkit.org/show_bug.cgi?id=182137
+
+        Reviewed by Chris Dumez.
+
+        Covered by rebased test.
+        In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.
+
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::redirectReceived):
+
+2018-01-25  Youenn Fablet  <[email protected]>
+
         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
         https://bugs.webkit.org/show_bug.cgi?id=182115
 

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (227625 => 227626)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2018-01-25 21:26:36 UTC (rev 227625)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2018-01-25 21:27:32 UTC (rev 227626)
@@ -293,6 +293,10 @@
         m_originalHeaders->remove(HTTPHeaderName::Authorization);
     request.setHTTPHeaderFields(*m_originalHeaders);
 
+#if ENABLE(SERVICE_WORKER)
+    if (redirectResponse.source() != ResourceResponse::Source::ServiceWorker && redirectResponse.source() != ResourceResponse::Source::MemoryCache)
+        m_options.serviceWorkersMode = ServiceWorkersMode::None;
+#endif
     makeCrossOriginAccessRequest(ResourceRequest(request));
     completionHandler(WTFMove(request));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to