Skip to content

Handling of server header responses with carriage return \r (IE11) #422

Closed

Description

@opinel

Hi,

I am seeing an issue with the fetch.js method when extracting header values in IE11.
My server response headers have a trailing carriage return "\r".
In Safari, the header value pairs are extracted correctly:

var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n')

However, in IE11, it considers the carriage return as a pair, too. Therefore it runs into an exception case when calling normalizeName() within the append() method, complaining that the header would include an invalid character "Invalid character in header field name".

Has someone experienced the same problem? And could be potentially filter carriage returns proactively?

Activity

  1. mislav commented on Oct 28, 2016

    @mislav
    Contributor

    Hi thanks for reporting. It's very weird that we chose to split headers on \n, because the HTTP spec dictates that headers should be split by \r\n always. Could you perhaps take a shot at making a test that demonstrates this failure in IE and submit a fix?

  2. locked as resolved and limited conversation to collaborators on Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions