Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallvord R. M. Steen committed Nov 3, 2014
1 parent 88b59d3 commit 065dfc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions XMLHttpRequest/setrequestheader-bogus-name.htm
Expand Up @@ -27,14 +27,15 @@
test(function() {
var client = new XMLHttpRequest()
client.open("GET", "...")
assert_throws("SyntaxError", function() { client.setRequestHeader(name, 'x-value') }, "setRequestHeader should throw with header name " +
format_value(invalid_headers[i]) + ".")
})
assert_throws("SyntaxError", function() { client.setRequestHeader(name, 'x-value') })
}, "setRequestHeader should throw with header name " + format_value(invalid_headers[i]) + ".")
}
var invalid_headers = ["(", ")", "<", ">", "@", ",", ";", ":", "\\",
"\"", "/", "[", "]", "?", "=", "{", "}", " ",
/* HT already tested in the loop below */
"\u007f", "テスト", "", "t\rt", "t\nt", "t: t", "t:t", "t<t", "t t", " tt", ":tt", "\ttt", "\vtt", "t\0t", "t\"t", "t,t", "t;t", "()[]{}", "a?B", "X-テスト", "a=B"]
"\u007f", "テスト", "", "t\rt", "t\nt", "t: t", "t:t",
"t<t", "t t", " tt", ":tt", "\ttt", "\vtt", "t\0t",
"t\"t", "t,t", "t;t", "()[]{}", "a?B", "X-テスト", "a=B"]
for (var i = 0; i < 32; ++i) {
invalid_headers.push(String.fromCharCode(i))
}
Expand Down
4 changes: 2 additions & 2 deletions XMLHttpRequest/setrequestheader-bogus-value.htm
Expand Up @@ -20,11 +20,11 @@
try_value("t\rt")
try_value("t\nt")
try_value("テスト")
// Omitted value argument

test(function() {
var client = new XMLHttpRequest()
client.open("GET", "...")
assert_throws(new "SyntaxError", function() { client.setRequestHeader("x-test") })
assert_throws(new "TypeError", function() { client.setRequestHeader("x-test") })
}, 'Omitted value argument')
</script>
</body>
Expand Down

0 comments on commit 065dfc5

Please sign in to comment.