Commit c3581fd4 authored by andersca's avatar andersca
Browse files

Reviewed by Geoff.

		Make sure that the test case tests '\n' and '\r' too.
		
        * fast/dom/xmlhttprequest-invalid-values.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dfc5666e
2007-06-20 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
Make sure that the test case tests '\n' and '\r' too.
* fast/dom/xmlhttprequest-invalid-values.html:
2007-06-20 Mitz Pettel <mitz@webkit.org>
 
Reviewed by Beth.
......@@ -31,8 +31,9 @@ function testInvalidHeaderName() {
debug('testInvalidHeaderName: ' + result);
}
function testInvalidHeaderValue() {
function testInvalidHeaderValues() {
var result = 'FAILURE';
var successCount = 0;
var req = new XMLHttpRequest();
req.open('GET', 'http://localhost', true)
......@@ -41,10 +42,27 @@ function testInvalidHeaderValue() {
req.setRequestHeader("X-Hack", "Test\r\nHost: www.example.com\r\n\r\nGET / HTTP/1.1");
} catch (e) {
if (e.code == DOMException.SYNTAX_ERR)
result = 'SUCCESS';
successCount++;
}
try {
req.setRequestHeader("X-Hack", "Test\nHost: www.example.com\n\nGET / HTTP/1.1");
} catch (e) {
if (e.code == DOMException.SYNTAX_ERR)
successCount++;
}
try {
req.setRequestHeader("X-Hack", "Test\rHost: www.example.com\r\rGET / HTTP/1.1");
} catch (e) {
if (e.code == DOMException.SYNTAX_ERR)
successCount++;
}
debug('testInvalidHeaderName: ' + result);
if (successCount == 3)
result = 'SUCCESS';
debug('testInvalidHeaderValues: ' + result);
}
function debug(str) {
......@@ -60,7 +78,7 @@ function runTest() {
testInvalidMethod();
testInvalidHeaderName();
testInvalidHeaderValue();
testInvalidHeaderValues();
}
</script>
<body onload="runTest()">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment