Refactor combine method, and update expected wpt results

Instead of creating an array with length of 1 of `b','`, then pushing
the first element of that array to `combined_value`, push a `b','`
directly to `combined_value`.

The web platform test for combining headers has been updated to reflect
the Fetch
spec (https://github.com/w3c/web-platform-tests/pull/3646). The expected
web platform test results that will be affected by this change are updated.
This commit is contained in:
Jeena Lee 2016-08-23 16:01:08 -07:00
parent 2c4b268a45
commit 8946a65c5a
2 changed files with 1 additions and 9 deletions

View file

@ -85,7 +85,7 @@ impl HeadersMethods for Headers {
let mut combined_value: Vec<u8> = vec![];
if let Some(v) = self.header_list.borrow().get_raw(&valid_name) {
combined_value = v[0].clone();
combined_value.push(b","[0]);
combined_value.push(b',');
}
combined_value.extend(valid_value.iter().cloned());
self.header_list.borrow_mut().set_raw(valid_name, vec![combined_value]);