mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Merge pull request #2765 from Manishearth/xhr-wpt-encoding
Fix encoding issues for getResponseHeader()
This commit is contained in:
commit
0974d21bcd
2 changed files with 2 additions and 6 deletions
|
@ -556,7 +556,8 @@ impl<'a> XMLHttpRequestMethods<'a> for JSRef<'a, XMLHttpRequest> {
|
||||||
self.filter_response_headers().iter().find(|h| {
|
self.filter_response_headers().iter().find(|h| {
|
||||||
name.eq_ignore_case(&FromStr::from_str(h.header_name().as_slice()).unwrap())
|
name.eq_ignore_case(&FromStr::from_str(h.header_name().as_slice()).unwrap())
|
||||||
}).map(|h| {
|
}).map(|h| {
|
||||||
FromStr::from_str(h.header_value().as_slice()).unwrap()
|
// rust-http doesn't decode properly, we'll convert it back to bytes here
|
||||||
|
ByteString::new(h.header_value().as_slice().chars().map(|c| { assert!(c <= '\u00FF'); c as u8 }).collect())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fn GetAllResponseHeaders(&self) -> ByteString {
|
fn GetAllResponseHeaders(&self) -> ByteString {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[getresponseheader-special-characters.htm]
|
|
||||||
type: testharness
|
|
||||||
[XMLHttpRequest: getResponseHeader() funny characters]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue