Title: [200754] branches/safari-601.1.46-branch

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (200753 => 200754)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2016-05-12 09:12:08 UTC (rev 200753)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2016-05-12 09:12:12 UTC (rev 200754)
@@ -1,5 +1,21 @@
 2016-05-12  Matthew Hanson  <[email protected]>
 
+        Merge r198050. rdar://problem/26228899
+
+    2016-03-11  Jiewen Tan  <[email protected]>
+
+            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-12  Matthew Hanson  <[email protected]>
+
         Merge r195724. rdar://problem/26228915
 
     2016-01-27  Said Abou-Hallawa  <[email protected]>

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


--- branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url-expected.txt	2016-05-12 09:12:12 UTC (rev 200754)
@@ -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.1.46-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html (0 => 200754)


--- branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/redirect-to-invalid-url.html	2016-05-12 09:12:12 UTC (rev 200754)
@@ -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.1.46-branch/LayoutTests/http/tests/navigation/resources/redirect-to-invalid-url-frame.php (0 => 200754)


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

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (200753 => 200754)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-05-12 09:12:08 UTC (rev 200753)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-05-12 09:12:12 UTC (rev 200754)
@@ -1,5 +1,22 @@
 2016-05-12  Matthew Hanson  <[email protected]>
 
+        Merge r198050. rdar://problem/26228899
+
+    2016-03-11  Jiewen Tan  <[email protected]>
+
+            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-12  Matthew Hanson  <[email protected]>
+
         Merge r195724. rdar://problem/26228915
 
     2016-01-27  Said Abou-Hallawa  <[email protected]>

Modified: branches/safari-601.1.46-branch/Source/WebCore/loader/SubresourceLoader.cpp (200753 => 200754)


--- branches/safari-601.1.46-branch/Source/WebCore/loader/SubresourceLoader.cpp	2016-05-12 09:12:08 UTC (rev 200753)
+++ branches/safari-601.1.46-branch/Source/WebCore/loader/SubresourceLoader.cpp	2016-05-12 09:12:12 UTC (rev 200754)
@@ -158,6 +158,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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to