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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html

Issue 18595008: Prevents sending of 'orgin' in the "Access-Control-Request-Headers" when preflight requests are mad… (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
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html
new file mode 100644
index 0000000000000000000000000000000000000000..bcf83280d1c9385aa10e3a7cdd5e66228069f86e
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html
@@ -0,0 +1,33 @@
+<html>
+<body>
+<p>Test that 'Origin' is not included in Access-Control-Request-Headers in a preflight request. 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:8000/xmlhttprequest/resources/access-control-preflight-request-headers-origin.php");
+xhr.setRequestHeader("X-Custom-Header", "PASS");
+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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698