blob: 0ce18714c470a30f3f488a7351a31ed0ad76618c [file] [log] [blame]
<html>
<body>
<p>Test that setRequestHeader throws a SYNTAX_ERR exception when called with an empty header name.</p>
<pre id="result">FAIL: script didn't run or raised an unexpected exception.</pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var result = "FAIL: no exception was caught";
var req = new XMLHttpRequest;
req.open("GET", "resources/print-headers.cgi", false);
try {
req.setRequestHeader("", "DUMMY");
} catch (ex) {
result = "SUCCESS: got exception " + ex;
}
document.getElementById("result").textContent = result;
</script>
</body>
</html>