Skip to content
Permalink
Browse files

Trim header values in GetResponseHeader

Fixes #24917
  • Loading branch information
Eijebong committed Nov 29, 2019
1 parent f9c69e8 commit a91176e7fcff703ad7f2f0af1d79a84fb103a027
@@ -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
});

@@ -6,15 +6,3 @@
[Header value: \\0hello_world]
expected: FAIL

[Header value: hello_world[tab\]]
expected: FAIL

[Header value: [tab\]hello_world[tab\]]
expected: FAIL

[Header value: hello_world__]
expected: FAIL

[Header value: __hello_world__]
expected: FAIL

0 comments on commit a91176e

Please sign in to comment.
You can’t perform that action at this time.