Skip to content

fails to parse headers containing line feed #489

@pseidemann

Description

@pseidemann

hi,
I have some quite old user agent Mozilla/5.0 (QtEmbedded; Linux) AppleWebKit/534.34 (KHTML, like Gecko) webkit/0.1 Safari/534.34 (some proprietary set-top box) which seem to include line feed between cookies when the server sends multiple Set-Cookie headers. I know that the new spec is that the user agent should join these headers with a comma , but it seems like before this was \n.
line feeds are deprecated but still allowed per https://tools.ietf.org/html/rfc7230.
if I change the regex for splitting the headers returned by xhr.getAllResponseHeaders() from /\r?\n/ to /\r\n/ the problem is solved for this user agent https://github.com/github/fetch/blob/eebaa2a1bc21eeba98ee00c9f94a0a4c2007cff1/fetch.js#L361.
from the specs it seems headers should always be delimited by \r\n so I wonder if this is the proper fix for my user agent.
without the fix, my requests to the server fail while using credentials: 'same-origin' because cookies are not send like they were received from the server.

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