blob: cee3d49568ed49c50589f1362b2e13be911b49b6 [file] [log] [blame]
<p>Test that custom headers are not sent with OPTIONS preflight request.</p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function resetStatus()
{
var req = new XMLHttpRequest;
req.open("GET", "/resources/reset-temp-file.php?filename=access-control-preflight-headers-status", false);
req.send();
}
function sendRequest()
{
try {
var req = new XMLHttpRequest;
req.open("GET", "http://localhost:8000/xmlhttprequest/resources/no-custom-header.php", false);
req.setRequestHeader("X-Custom-Header", "foobar");
req.send();
document.write("<xmp>" + req.responseText + "</xmp>");
} catch (ex) {
document.write("<xmp>" + ex + "</xmp>");
}
}
resetStatus();
sendRequest();
</script>