Title: [233491] trunk/Source/WebKit
Revision
233491
Author
[email protected]
Date
2018-07-03 17:24:50 -0700 (Tue, 03 Jul 2018)

Log Message

Fix regression introduced in r233335
https://bugs.webkit.org/show_bug.cgi?id=187282

Reviewed by Chris Dumez.

When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
which should only be used for subresource loads.

Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
being no longer flaky.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::isValidFetch):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (233490 => 233491)


--- trunk/Source/WebKit/ChangeLog	2018-07-04 00:11:45 UTC (rev 233490)
+++ trunk/Source/WebKit/ChangeLog	2018-07-04 00:24:50 UTC (rev 233491)
@@ -1,3 +1,20 @@
+2018-07-03  Youenn Fablet  <[email protected]>
+
+        Fix regression introduced in r233335
+        https://bugs.webkit.org/show_bug.cgi?id=187282
+
+        Reviewed by Chris Dumez.
+
+        When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
+        Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
+        which should only be used for subresource loads.
+
+        Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
+        being no longer flaky.
+
+        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+        (WebKit::isValidFetch):
+
 2018-07-03  Chris Dumez  <[email protected]>
 
         Make CallbackMap::invalidate() safe to re-enter

Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (233490 => 233491)


--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-07-04 00:11:45 UTC (rev 233490)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-07-04 00:24:50 UTC (rev 233491)
@@ -189,12 +189,15 @@
     if (!serviceWorkerURL.protocolIsInHTTPFamily())
         return true;
 
-    if (options.mode == FetchOptions::Mode::Navigate && !protocolHostAndPortAreEqual(request.url(), serviceWorkerURL)) {
-        RELEASE_LOG_ERROR(ServiceWorker, "Should not intercept a navigation load that is not same-origin as the service worker URL");
-        RELEASE_ASSERT_WITH_MESSAGE(request.url().host() == serviceWorkerURL.host(), "Hosts do not match");
-        RELEASE_ASSERT_WITH_MESSAGE(request.url().protocol() == serviceWorkerURL.protocol(), "Protocols do not match");
-        RELEASE_ASSERT_WITH_MESSAGE(request.url().port() == serviceWorkerURL.port(), "Ports do not match");
-        return false;
+    if (options.mode == FetchOptions::Mode::Navigate) {
+        if (!protocolHostAndPortAreEqual(request.url(), serviceWorkerURL)) {
+            RELEASE_LOG_ERROR(ServiceWorker, "Should not intercept a navigation load that is not same-origin as the service worker URL");
+            RELEASE_ASSERT_WITH_MESSAGE(request.url().host() == serviceWorkerURL.host(), "Hosts do not match");
+            RELEASE_ASSERT_WITH_MESSAGE(request.url().protocol() == serviceWorkerURL.protocol(), "Protocols do not match");
+            RELEASE_ASSERT_WITH_MESSAGE(request.url().port() == serviceWorkerURL.port(), "Ports do not match");
+            return false;
+        }
+        return true;
     }
 
     String origin = request.httpOrigin();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to