mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Throw on bad ByteStrings
This commit is contained in:
parent
e733a7c46a
commit
3129fb2330
3 changed files with 14 additions and 1 deletions
|
@ -577,7 +577,7 @@ impl FromJSValConvertible for ByteString {
|
|||
let char_vec = slice::from_raw_parts(chars, length as usize);
|
||||
|
||||
if char_vec.iter().any(|&c| c > 0xFF) {
|
||||
// XXX Throw
|
||||
throw_type_error(cx, "Invalid ByteString");
|
||||
Err(())
|
||||
} else {
|
||||
Ok(ByteString::new(char_vec.iter().map(|&c| c as u8).collect()))
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[setrequestheader-bogus-name.htm]
|
||||
type: testharness
|
||||
[setRequestHeader should throw with header name "テスト".]
|
||||
expected: FAIL
|
||||
|
||||
[setRequestHeader should throw with header name "X-テスト".]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[setrequestheader-bogus-value.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: setRequestHeader() value argument checks 4]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue