mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-06 09:29:35 +00:00
43 lines
1.6 KiB
HTML
43 lines
1.6 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>XMLHttpRequest: setRequestHeader() with invalid arguments</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="log"></div>
|
|
<!--
|
|
CHAR = <any US-ASCII character (octets 0 - 127)>
|
|
CTL = <any US-ASCII control character
|
|
(octets 0 - 31) and DEL (127)>
|
|
SP = <US-ASCII SP, space (32)>
|
|
HT = <US-ASCII HT, horizontal-tab (9)>
|
|
token = 1*<any CHAR except CTLs or separators>
|
|
separators = "(" | ")" | "<" | ">" | "@"
|
|
| "," | ";" | ":" | "\" | <">
|
|
| "/" | "[" | "]" | "?" | "="
|
|
| "{" | "}" | SP | HT
|
|
field-name = token
|
|
-->
|
|
<script>
|
|
var invalid_headers = ["(", ")", "<", ">", "@", ",", ";", ":", "\\",
|
|
"\"", "/", "[", "]", "?", "=", "{", "}", " ",
|
|
"\u0009", "\u007f"]
|
|
for (var i = 0; i < 32; ++i) {
|
|
invalid_headers.push(String.fromCharCode(i))
|
|
}
|
|
for (var i = 0; i < invalid_headers.length; ++i) {
|
|
test(function() {
|
|
assert_throws("SYNTAX_ERR", function() {
|
|
var client = new XMLHttpRequest()
|
|
client.open("GET", "../resources/delay.php?ms=0")
|
|
client.setRequestHeader(invalid_headers[i], "test")
|
|
}, "setRequestHeader should throw with header " +
|
|
format_value(invalid_headers[i]) +".")
|
|
})
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|