Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/redirect-cors-origin-null.html

Issue 20735002: CORS: Fix the handling of redirected request containing Origin null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/redirect-cors-origin-null.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/redirect-cors-origin-null.html b/LayoutTests/http/tests/xmlhttprequest/redirect-cors-origin-null.html
new file mode 100755
index 0000000000000000000000000000000000000000..d2653a592949c4a7c948b990e3b2242b73806521
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/redirect-cors-origin-null.html
@@ -0,0 +1,33 @@
+<html>
+<body>
+<p>Test opera W3C test suite(http://w3c-test.org/webappsec/tests/cors/submitted/opera/staging/redirect-origin.htm) test case 13 for redirection.<br>
+Request URL origin is not same origin with the original URL origin. Final response contains "Access-Control-Allow-Origin: null". Should print PASS.</p>
+<div id="log"></div>
+<script>
+function log(message) {
+ document.getElementById("log").innerHTML += message + "<br>";
+}
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+var xhr = new XMLHttpRequest();
+xhr.open("GET", "http://localhost:8080/xmlhttprequest/resources/redirect-cors-origin-null.php");
+xhr.onerror = function () {
+ log("FAIL");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+};
+xhr.onreadystatechange = function () {
+ if (xhr.readyState == 4) {
+ log(xhr.responseText);
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+};
+xhr.send();
+
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698