Merge pull request #2765 from Manishearth/xhr-wpt-encoding

Fix encoding issues for getResponseHeader()
This commit is contained in:
Simon Sapin 2014-07-04 23:36:22 +01:00
commit 0974d21bcd
2 changed files with 2 additions and 6 deletions

View file

@ -556,7 +556,8 @@ impl<'a> XMLHttpRequestMethods<'a> for JSRef<'a, XMLHttpRequest> {
self.filter_response_headers().iter().find(|h| {
name.eq_ignore_case(&FromStr::from_str(h.header_name().as_slice()).unwrap())
}).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 {