-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Headers multiple value handling for spec compatibility
Consider this Headers object: var h = new Headers() h.append('accept', 'text/html') h.append('accept', 'text/plain') h.append('content-type', 'application/json') Before: - `h.get('accept')` returned `text/html` - `h.getAll('accept')` returned an array of values - `h.forEach` (and other iterables) did distinct iterations for each value of the same header Now: - `h.get('accept')` returns `text/html,text/plain` - `h.getAll()` is no more - `h.forEach` (and other iterables) now only do one iteration for each headers name, regardless of multiple values This is in accordance with Section 3.1.2 of the spec, "combine" concept. The updated tests currently break in Chrome and Firefox when exercising the native implementation because their implementation is outdated. The implementation in Edge is more correct, but the tests still fail there because its implementation combines values with `, ` (notice the space) rather than `,`.
- Loading branch information
Showing
2 changed files
with
21 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters