Skip to content
Permalink
Browse files

Auto merge of #24940 - Eijebong:trim-header, r=jdm

Trim header values in GetResponseHeader

Fixes #24917
  • Loading branch information
bors-servo committed Dec 2, 2019
2 parents ae0b086 + a91176e commit 87c1019c5deafd128acd76f083e63f1a285bb1e0
@@ -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 87c1019

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