blob: c9e2b427509ffeb1e2195e703d5227a98c057f64 [file] [log] [blame]
<html>
<body>
<p>Test that setRequestHeader can be used to set headers that have a name, but no value.</p>
<pre id=result>FAIL: script didn't run or raised an unexpected exception.</pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
req = new XMLHttpRequest;
req.open("GET", "resources/print-headers.cgi", false);
req.setRequestHeader("CUSTOM-HEADER", "");
try {
req.send("");
if (req.responseText.indexOf("HTTP_CUSTOM_HEADER") >= 0)
document.getElementById("result").textContent = "SUCCESS";
else
document.getElementById("result").textContent = req.responseText;
} catch (ex) {
document.getElementById("result").textContent = ex;
}
</script>
</body>
</html>