mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix encoding issues for getResponseHeader()
This commit is contained in:
parent
f3b9c11f7a
commit
3f15dc6c47
1 changed files with 2 additions and 1 deletions
|
@ -556,7 +556,8 @@ impl<'a> XMLHttpRequestMethods<'a> for JSRef<'a, XMLHttpRequest> {
|
||||||
self.response_headers.deref().borrow().iter().find(|h| {
|
self.response_headers.deref().borrow().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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue