Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Headers multiple value handling for spec compatibility #429

Merged
merged 2 commits into from Nov 14, 2016
Merged

Change Headers multiple value handling for spec compatibility #429

merged 2 commits into from Nov 14, 2016

Commits on Nov 10, 2016

  1. 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 `,`.
    mislav committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    02b1dcb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    468f877 View commit details
    Browse the repository at this point in the history