blob: 6fcf72e70f1d0d9757a4246b9c0ee233aef321e9 [file] [log] [blame]
<p>Test that custom headers are not sent with OPTIONS preflight request.</p>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function resetStatus()
{
var req = new XMLHttpRequest;
req.open("GET", "/resources/reset-temp-file.py?filename=access-control-preflight-headers-async-status", false);
req.send();
}
function sendRequest()
{
var req = new XMLHttpRequest;
req.open("GET", "http://localhost:8000/xmlhttprequest/resources/no-custom-header.py?filename=access-control-preflight-headers-async-status");
req.setRequestHeader("X-Custom-Header", "foobar");
req.onerror = function() {
document.body.appendChild(document.createTextNode("FAIL: onerror called"));
if (window.testRunner)
testRunner.notifyDone();
}
req.onload = function() {
document.body.appendChild(document.createTextNode(req.responseText));
if (window.testRunner)
testRunner.notifyDone();
}
req.send();
}
resetStatus();
sendRequest();
</script>