Title: [227624] trunk
Revision
227624
Author
[email protected]
Date
2018-01-25 13:12:38 -0800 (Thu, 25 Jan 2018)

Log Message

Registering same scope as the script directory without the last slash should fail
https://bugs.webkit.org/show_bug.cgi?id=182122
<rdar://problem/36877167>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

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

Source/WebCore:

This aligns our behavior with Firefox and Chrome.

No new tests, rebaselined existing test.

* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::didReceiveResponse):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (227623 => 227624)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-25 20:23:43 UTC (rev 227623)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-25 21:12:38 UTC (rev 227624)
@@ -1,3 +1,15 @@
+2018-01-25  Chris Dumez  <[email protected]>
+
+        Registering same scope as the script directory without the last slash should fail
+        https://bugs.webkit.org/show_bug.cgi?id=182122
+        <rdar://problem/36877167>
+
+        Reviewed by Youenn Fablet.
+
+        Rebaseline WPT test now that one more check is passing.
+
+        * web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:
+
 2018-01-25  Antoine Quint  <[email protected]>
 
         [Web Animations] Expose the reverse() method

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt (227623 => 227624)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt	2018-01-25 20:23:43 UTC (rev 227623)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt	2018-01-25 21:12:38 UTC (rev 227624)
@@ -1,5 +1,5 @@
 
-FAIL Registering same scope as the script directory without the last slash assert_unreached: Should have rejected: Registering same scope as the script directory without the last slash should fail with SecurityError. Reached unreachable code
+PASS Registering same scope as the script directory without the last slash 
 PASS Registration scope outside the script directory 
 PASS Registering scope outside domain 
 PASS Registering script outside domain 

Modified: trunk/Source/WebCore/ChangeLog (227623 => 227624)


--- trunk/Source/WebCore/ChangeLog	2018-01-25 20:23:43 UTC (rev 227623)
+++ trunk/Source/WebCore/ChangeLog	2018-01-25 21:12:38 UTC (rev 227624)
@@ -1,3 +1,18 @@
+2018-01-25  Chris Dumez  <[email protected]>
+
+        Registering same scope as the script directory without the last slash should fail
+        https://bugs.webkit.org/show_bug.cgi?id=182122
+        <rdar://problem/36877167>
+
+        Reviewed by Youenn Fablet.
+
+        This aligns our behavior with Firefox and Chrome.
+
+        No new tests, rebaselined existing test.
+
+        * workers/service/ServiceWorkerJob.cpp:
+        (WebCore::ServiceWorkerJob::didReceiveResponse):
+
 2018-01-25  Antoine Quint  <[email protected]>
 
         [Web Animations] Expose the reverse() method

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp (227623 => 227624)


--- trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp	2018-01-25 20:23:43 UTC (rev 227623)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp	2018-01-25 21:12:38 UTC (rev 227624)
@@ -122,7 +122,7 @@
     if (serviceWorkerAllowed.isNull()) {
         String path = m_jobData.scriptURL.path();
         // Last part of the path is the script's filename.
-        maxScopeString = path.substring(0, path.reverseFind('/'));
+        maxScopeString = path.substring(0, path.reverseFind('/') + 1);
     } else {
         auto maxScope = URL(m_jobData.scriptURL, serviceWorkerAllowed);
         maxScopeString = maxScope.path();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to