Diff
Modified: releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog (197275 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog 2016-02-28 11:43:14 UTC (rev 197275)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog 2016-02-28 11:45:27 UTC (rev 197276)
@@ -1,3 +1,20 @@
+2015-04-24 Brady Eidson <[email protected]>
+
+ Origin header is preserved on cross-origin redirects.
+ https://bugs.webkit.org/show_bug.cgi?id=144157.
+
+ Reviewed by Sam Weinig.
+
+ * http/tests/security/cors-post-redirect-301-expected.txt: Added.
+ * http/tests/security/cors-post-redirect-301.html: Added.
+ * http/tests/security/cors-post-redirect-302-expected.txt: Added.
+ * http/tests/security/cors-post-redirect-302.html: Added.
+ * http/tests/security/cors-post-redirect-307-expected.txt: Added.
+ * http/tests/security/cors-post-redirect-307.html: Added.
+ * http/tests/security/cors-post-redirect-308-expected.txt: Added.
+ * http/tests/security/cors-post-redirect-308.html: Added.
+ * http/tests/security/resources/cors-post-redirect-target.php: Added.
+
2015-04-27 Daniel Bates <[email protected]>
Form control may be associated with the wrong HTML Form element after form id change
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301-expected.txt (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301-expected.txt 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1 @@
+There was no origin header
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301.html (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301.html (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-301.html 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1,24 @@
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
+</head>
+<body>
+
+This test is designed to work only when loaded from http://127.0.0.1:8000
+
+<form id='testForm' method='POST'>
+<input id='redircode' type='hidden' name='redircode' value='301'>
+</form>
+
+<script>
+
+var form = document.getElementById('testForm');
+form.action = ""
+form.submit();
+
+</script>
+</body>
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302-expected.txt (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302-expected.txt 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1 @@
+There was no origin header
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302.html (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302.html (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-302.html 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1,24 @@
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
+</head>
+<body>
+
+This test is designed to work only when loaded from http://127.0.0.1:8000
+
+<form id='testForm' method='POST'>
+<input id='redircode' type='hidden' name='redircode' value='302'>
+</form>
+
+<script>
+
+var form = document.getElementById('testForm');
+form.action = ""
+form.submit();
+
+</script>
+</body>
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307-expected.txt (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307-expected.txt 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1 @@
+There was no origin header
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307.html (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307.html (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-307.html 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1,24 @@
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
+</head>
+<body>
+
+This test is designed to work only when loaded from http://127.0.0.1:8000
+
+<form id='testForm' method='POST'>
+<input id='redircode' type='hidden' name='redircode' value='307'>
+</form>
+
+<script>
+
+var form = document.getElementById('testForm');
+form.action = ""
+form.submit();
+
+</script>
+</body>
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308-expected.txt (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308-expected.txt 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1 @@
+There was no origin header
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308.html (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308.html (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/cors-post-redirect-308.html 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1,24 @@
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
+</head>
+<body>
+
+This test is designed to work only when loaded from http://127.0.0.1:8000
+
+<form id='testForm' method='POST'>
+<input id='redircode' type='hidden' name='redircode' value='308'>
+</form>
+
+<script>
+
+var form = document.getElementById('testForm');
+form.action = ""
+form.submit();
+
+</script>
+</body>
Added: releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/resources/cors-post-redirect-target.php (0 => 197276)
--- releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/resources/cors-post-redirect-target.php (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/http/tests/security/resources/cors-post-redirect-target.php 2016-02-28 11:45:27 UTC (rev 197276)
@@ -0,0 +1,17 @@
+<?php
+$sawOrigin = false;
+foreach (getallheaders() as $name => $value) {
+ if (strtolower($name) == "origin") {
+ echo "Origin header value: $value";
+ $sawOrigin = true;
+ }
+}
+
+if (!$sawOrigin)
+ echo "There was no origin header";
+
+?>
+<script>
+if (window.testRunner)
+ testRunner.notifyDone();
+</script>
Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog (197275 => 197276)
--- releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog 2016-02-28 11:43:14 UTC (rev 197275)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog 2016-02-28 11:45:27 UTC (rev 197276)
@@ -1,3 +1,32 @@
+2015-05-01 Martin Robinson <[email protected]>
+
+ [GTK] New CORS tests from r183280 fail on WebKitGTK+
+ https://bugs.webkit.org/show_bug.cgi?id=144469
+
+ Reviewed by Sergio Villar Senin.
+
+ No new tests. This causes failing tests to pass.
+
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
+
+2015-04-24 Brady Eidson <[email protected]>
+
+ Origin header is preserved on cross-origin redirects.
+ https://bugs.webkit.org/show_bug.cgi?id=144157.
+
+ Reviewed by Sam Weinig.
+
+ Tests: http/tests/security/cors-post-redirect-301.html
+ http/tests/security/cors-post-redirect-302.html
+ http/tests/security/cors-post-redirect-307.html
+ http/tests/security/cors-post-redirect-308.html
+
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::willSendRequest): Always clear any origin header for cross-origin redirects.
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::willSendRequest): Ditto.
+
2015-04-27 Daniel Bates <[email protected]>
Form control may be associated with the wrong HTML Form element after form id change
Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (197275 => 197276)
--- releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2016-02-28 11:43:14 UTC (rev 197275)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2016-02-28 11:45:27 UTC (rev 197276)
@@ -273,9 +273,10 @@
request.removeCredentials();
if (!protocolHostAndPortAreEqual(request.url(), redirectResponse.url())) {
- // If the network layer carries over authentication headers from the original request
- // in a cross-origin redirect, we want to clear those headers here.
+ // The network layer might carry over some headers from the original request that
+ // we want to strip here because the redirect is cross-origin.
request.clearHTTPAuthorization();
+ request.clearHTTPOrigin();
} else {
// Only consider applying authentication credentials if this is actually a redirect and the redirect
// URL didn't include credentials of its own.
Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (197275 => 197276)
--- releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2016-02-28 11:43:14 UTC (rev 197275)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2016-02-28 11:45:27 UTC (rev 197276)
@@ -456,10 +456,10 @@
request.removeCredentials();
if (!protocolHostAndPortAreEqual(request.url(), redirectResponse.url())) {
- // If the network layer carries over authentication headers from the original request
- // in a cross-origin redirect, we want to clear those headers here.
- // As of Lion, CFNetwork no longer does this.
+ // The network layer might carry over some headers from the original request that
+ // we want to strip here because the redirect is cross-origin.
request.clearHTTPAuthorization();
+ request.clearHTTPOrigin();
} else {
// Only consider applying authentication credentials if this is actually a redirect and the redirect
// URL didn't include credentials of its own.
Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (197275 => 197276)
--- releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2016-02-28 11:43:14 UTC (rev 197275)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2016-02-28 11:45:27 UTC (rev 197276)
@@ -525,6 +525,7 @@
// If the network layer carries over authentication headers from the original request
// in a cross-origin redirect, we want to clear those headers here.
newRequest.clearHTTPAuthorization();
+ newRequest.clearHTTPOrigin();
// TODO: We are losing any username and password specified in the redirect URL, as this is the
// same behavior as the CFNet port. We should investigate if this is really what we want.