Trim header values in GetResponseHeader

Fixes #24917
This commit is contained in:
Bastien Orivel 2019-11-29 19:19:03 +01:00
parent f9c69e84a9
commit a91176e7fc
2 changed files with 4 additions and 14 deletions

View file

@ -783,8 +783,10 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
if !first {
vec.extend(", ".as_bytes());
}
first = false;
vec.extend(value.as_bytes());
if let Ok(v) = str::from_utf8(value.as_bytes()).map(|s| s.trim().as_bytes()) {
vec.extend(v);
first = false;
}
vec
});