3 <p>Test that setRequestHeader properly checks for line feeds in header values.
</p>
6 testRunner
.dumpAsText();
9 var req
= new XMLHttpRequest
;
10 req
.open("GET", "resources/print-headers.cgi", false);
13 req
.setRequestHeader("Test", val
);
15 document
.write("<p>" + escape(val
) + " -> SUCCESS, setRequestHeader() raised an exception " + ex
+ "</p>");
21 if (req
.responseText
.match("HTTP_EVIL"))
22 document
.write("<p>" + escape(val
) + " -> FAILURE - evil header injected!</p>");
24 document
.write("<p>" + escape(val
) + " -> setRequestHeader() didn't throw, but server didn't see the evil header.</p>");
27 alert("Unexpected exception: " + ex
);