1 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=22731">bug
22731</a>:
2 Newline in XMLHttpRequest URL can be used to remove HTTP headers (e.g. Host:).
</p>
3 <pre id=
"lf">LF FAIL: test did not run
</pre>
4 <pre id=
"cr">CR FAIL: test did not run
</pre>
7 testRunner
.dumpAsText();
9 var req
= new XMLHttpRequest
;
10 req
.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/print-headers.cgi\n", false);
12 if (req
.responseText
.match(/HTTP_HOST: 127.0.0.1:8000/))
13 document
.getElementById("lf").innerHTML
= "LF SUCCESS";
15 document
.getElementById("lf").innerHTML
= "LF FAIL. Headers are:\n" + req
.responseText
;
17 req
.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/print-headers.cgi\r", false);
19 if (req
.responseText
.match(/HTTP_HOST: 127.0.0.1:8000/))
20 document
.getElementById("cr").innerHTML
= "CR SUCCESS";
22 document
.getElementById("cr").innerHTML
= "CR FAIL. Headers are:\n" + req
.responseText
;