Title: [200730] branches/safari-601-branch

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (200729 => 200730)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2016-05-12 01:31:47 UTC (rev 200729)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2016-05-12 01:31:51 UTC (rev 200730)
@@ -1,5 +1,21 @@
 2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r198050. rdar://problem/26228588
+
+    2016-03-11  Jiewen Tan  <jiewen_...@apple.com>
+
+            WebKit should not be redirected to an invalid URL
+            https://bugs.webkit.org/show_bug.cgi?id=155263
+            <rdar://problem/22820172>
+
+            Reviewed by Brent Fulgham.
+
+            * http/tests/navigation/redirect-to-invalid-url-expected.txt: Added.
+            * http/tests/navigation/redirect-to-invalid-url.html: Added.
+            * http/tests/navigation/resources/redirect-to-invalid-url-frame.php: Added.
+
+2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r195724. rdar://problem/26228611
 
     2016-01-27  Said Abou-Hallawa  <sabouhall...@apple.com>

Added: branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url-expected.txt (0 => 200730)


--- branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url-expected.txt	2016-05-12 01:31:51 UTC (rev 200730)
@@ -0,0 +1,6 @@
+http://127.0.0.1:8000/navigation/resources/redirect-to-invalid-url-frame.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/navigation/resources/redirect-to-invalid-url-frame.php, main document URL http://127.0.0.1:8000/navigation/redirect-to-invalid-url.html, http method GET> redirectResponse (null)
+http://127.0.0.1:8000/navigation/redirect-to-invalid-url.html - didFinishLoading
+http://127.0.0.1:8000/navigation/resources/redirect-to-invalid-url-frame.php - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 101, failing URL "http://127.0.0.1:8000/navigation/resources/redirect-to-invalid-url-frame.php">
+Test passes if WebKit doesn't request the redirected URL.
+
+

Added: branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html (0 => 200730)


--- branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html	2016-05-12 01:31:51 UTC (rev 200730)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.dumpResourceLoadCallbacks();
+        testRunner.waitUntilDone();
+    }
+
+    _onload_ = function() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }
+</script>
+</head>
+<body>
+    <p>Test passes if WebKit doesn't request the redirected URL.</p>
+    <iframe src=""
+</body>
+</html>

Added: branches/safari-601-branch/LayoutTests/http/tests/navigation/resources/redirect-to-invalid-url-frame.php (0 => 200730)


--- branches/safari-601-branch/LayoutTests/http/tests/navigation/resources/redirect-to-invalid-url-frame.php	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/navigation/resources/redirect-to-invalid-url-frame.php	2016-05-12 01:31:51 UTC (rev 200730)
@@ -0,0 +1,4 @@
+<?php
+header('Location: http://localhost:xyz/none-existed.html');
+?>
+

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (200729 => 200730)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2016-05-12 01:31:47 UTC (rev 200729)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2016-05-12 01:31:51 UTC (rev 200730)
@@ -1,5 +1,22 @@
 2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r198050. rdar://problem/26228588
+
+    2016-03-11  Jiewen Tan  <jiewen_...@apple.com>
+
+            WebKit should not be redirected to an invalid URL
+            https://bugs.webkit.org/show_bug.cgi?id=155263
+            <rdar://problem/22820172>
+
+            Reviewed by Brent Fulgham.
+
+            Test: http/tests/navigation/redirect-to-invalid-url.html
+
+            * loader/SubresourceLoader.cpp:
+            (WebCore::SubresourceLoader::willSendRequestInternal):
+
+2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r195724. rdar://problem/26228611
 
     2016-01-27  Said Abou-Hallawa  <sabouhall...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp (200729 => 200730)


--- branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp	2016-05-12 01:31:47 UTC (rev 200729)
+++ branches/safari-601-branch/Source/WebCore/loader/SubresourceLoader.cpp	2016-05-12 01:31:51 UTC (rev 200730)
@@ -159,6 +159,11 @@
     URL previousURL = request().url();
     Ref<SubresourceLoader> protect(*this);
 
+    if (!newRequest.url().isValid()) {
+        cancel(cannotShowURLError());
+        return;
+    }
+
     ASSERT(!newRequest.isNull());
     if (!redirectResponse.isNull()) {
         // CachedResources are keyed off their original request URL.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to