Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-preflight-request-headers-origin.html
blobbcf83280d1c9385aa10e3a7cdd5e66228069f86e
1 <html>
2 <body>
3 <p>Test that 'Origin' is not included in Access-Control-Request-Headers in a preflight request. Should print PASS.</p>
4 <div id="log"></div>
5 <script>
6 function log(message) {
7 document.getElementById("log").innerHTML += message + "<br>";
10 if (window.layoutTestController) {
11 layoutTestController.dumpAsText();
12 layoutTestController.waitUntilDone();
15 var xhr = new XMLHttpRequest();
16 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-request-headers-origin.php");
17 xhr.setRequestHeader("X-Custom-Header", "PASS");
18 xhr.onerror = function () {
19 log("FAIL");
20 if (window.layoutTestController)
21 layoutTestController.notifyDone();
23 xhr.onreadystatechange = function () {
24 if (xhr.readyState == 4) {
25 log(xhr.responseText);
26 if (window.layoutTestController)
27 layoutTestController.notifyDone();
30 xhr.send();
32 </script>
33 </html>