Title: [143952] releases/WebKitGTK/webkit-2.0
Revision
143952
Author
[email protected]
Date
2013-02-25 11:27:03 -0800 (Mon, 25 Feb 2013)

Log Message

Merge r143931 - [soup] "Too many redirects" error loading chat in plus.google.com
https://bugs.webkit.org/show_bug.cgi?id=64575

Reviewed by Martin Robinson.

Source/WebCore:

Set the firstPartyForCookies for the new request on redirects to
the URL used for redirection.

Test: http/tests/cookies/set-cookie-on-redirect.html

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::doRedirect):

LayoutTests:

This new test checks firstPartyForCookies is properly set to the
new URL on redirects.

* http/tests/cookies/resources/set-cookie-on-redirect.php: Added.
* http/tests/cookies/set-cookie-on-redirect-expected.txt: Added.
* http/tests/cookies/set-cookie-on-redirect.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog (143951 => 143952)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog	2013-02-25 19:23:04 UTC (rev 143951)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog	2013-02-25 19:27:03 UTC (rev 143952)
@@ -1,3 +1,17 @@
+2013-02-25  Sergio Villar Senin  <[email protected]>
+
+        [soup] "Too many redirects" error loading chat in plus.google.com
+        https://bugs.webkit.org/show_bug.cgi?id=64575
+
+        Reviewed by Martin Robinson.
+
+        This new test checks firstPartyForCookies is properly set to the
+        new URL on redirects.
+
+        * http/tests/cookies/resources/set-cookie-on-redirect.php: Added.
+        * http/tests/cookies/set-cookie-on-redirect-expected.txt: Added.
+        * http/tests/cookies/set-cookie-on-redirect.html: Added.
+
 2013-02-21  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r143581.

Added: releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/resources/set-cookie-on-redirect.php (0 => 143952)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/resources/set-cookie-on-redirect.php	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/resources/set-cookie-on-redirect.php	2013-02-25 19:27:03 UTC (rev 143952)
@@ -0,0 +1,18 @@
+<?php
+if ($_GET['step'] == 1) {
+  header("HTTP/1.0 302 Found");
+  header('Location: http://localhost:8000/cookies/resources/set-cookie-on-redirect.php?step=2');
+} else if ($_GET['step'] == 2) {
+  header("HTTP/1.0 302 Found");
+  setcookie("test_cookie", "1");
+  header('Location: http://localhost:8000/cookies/resources/set-cookie-on-redirect.php?step=3');
+} else if ($_GET['step'] == 3) {
+  header("HTTP/1.0 200 OK");
+  if (isset($_COOKIE['test_cookie'])) {
+    echo "PASSED: Cookie successfully set\n";
+  } else {
+    echo "FAILED: Cookie not set\n";
+  }
+  echo "<script> if (window.testRunner) testRunner.notifyDone();</script>\n";
+}
+?>

Added: releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect-expected.txt (0 => 143952)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect-expected.txt	2013-02-25 19:27:03 UTC (rev 143952)
@@ -0,0 +1 @@
+PASSED: Cookie successfully set

Added: releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect.html (0 => 143952)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/http/tests/cookies/set-cookie-on-redirect.html	2013-02-25 19:27:03 UTC (rev 143952)
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function doRedirect()
+{
+  window.location = "http://127.0.0.1:8000/cookies/resources/set-cookie-on-redirect.php?step=1";
+}
+</script>
+
+<body _onload_="doRedirect()">
+<!-- Test for https://bugs.webkit.org/show_bug.cgi?id=64575 -->
+<!-- For this test to pass you should see "PASSED: Cookie successfully set" -->
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.0/Source/WebCore/ChangeLog (143951 => 143952)


--- releases/WebKitGTK/webkit-2.0/Source/WebCore/ChangeLog	2013-02-25 19:23:04 UTC (rev 143951)
+++ releases/WebKitGTK/webkit-2.0/Source/WebCore/ChangeLog	2013-02-25 19:27:03 UTC (rev 143952)
@@ -1,3 +1,18 @@
+2013-02-25  Sergio Villar Senin  <[email protected]>
+
+        [soup] "Too many redirects" error loading chat in plus.google.com
+        https://bugs.webkit.org/show_bug.cgi?id=64575
+
+        Reviewed by Martin Robinson.
+
+        Set the firstPartyForCookies for the new request on redirects to
+        the URL used for redirection.
+
+        Test: http/tests/cookies/set-cookie-on-redirect.html
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::doRedirect):
+
 2013-02-21  Claudio Saavedra  <[email protected]>
 
         [GTK] Control+Shift+Up/Down selection works backwards

Modified: releases/WebKitGTK/webkit-2.0/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (143951 => 143952)


--- releases/WebKitGTK/webkit-2.0/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-02-25 19:23:04 UTC (rev 143951)
+++ releases/WebKitGTK/webkit-2.0/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-02-25 19:27:03 UTC (rev 143952)
@@ -459,6 +459,7 @@
     KURL newURL = KURL(soupURIToKURL(soup_message_get_uri(message)), location);
     bool crossOrigin = !protocolHostAndPortAreEqual(handle->firstRequest().url(), newURL);
     newRequest.setURL(newURL);
+    newRequest.setFirstPartyForCookies(newURL);
 
     if (newRequest.httpMethod() != "GET") {
         // Change newRequest method to GET if change was made during a previous redirection
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to