Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-preflight-headers-async.html
blobb1d413afbc32047e9d08a54e6e646b1cde177c72
1 <p>Test that custom headers are not sent with OPTIONS preflight request.</p>
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 function resetStatus()
10 var req = new XMLHttpRequest;
11 req.open("GET", "/resources/reset-temp-file.php?filename=access-control-preflight-headers-status", false);
12 req.send();
15 function sendRequest()
17 var req = new XMLHttpRequest;
18 req.open("GET", "http://localhost:8000/xmlhttprequest/resources/no-custom-header.php");
19 req.setRequestHeader("X-Custom-Header", "foobar");
20 req.onerror = function() {
21 document.body.appendChild(document.createTextNode("FAIL: onerror called"));
22 if (window.testRunner)
23 testRunner.notifyDone();
25 req.onload = function() {
26 document.body.appendChild(document.createTextNode(req.responseText));
27 if (window.testRunner)
28 testRunner.notifyDone();
30 req.send();
33 resetStatus();
34 sendRequest();
35 </script>