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

HTTP spec allows multiple headers with the same key #102

Open
devinus opened this issue Oct 15, 2015 · 2 comments
Open

HTTP spec allows multiple headers with the same key #102

devinus opened this issue Oct 15, 2015 · 2 comments
Labels

Comments

@devinus
Copy link

devinus commented Oct 15, 2015

Using a map to represent headers is therefore wrong.

Example is multiple Set-Cookie headers.

@jfacorro jfacorro added the bug label Oct 26, 2015
@kennethlakin
Copy link
Contributor

Perhaps I'm misinterpreting this, but the second-to-last paragraph of section 3.2.2 of RFC 7230 [0] seems to permit exactly what we're doing.... assuming that we're joining the additional field-values to the first field-value in a comma-separated list:

A recipient MAY combine multiple header fields with the same field
name into one "field-name: field-value" pair, without changing the
semantics of the message, by appending each subsequent field value to
the combined field value in order, separated by a comma. The order
in which header fields with the same field name are received is
therefore significant to the interpretation of the combined field
value; a proxy MUST NOT change the order of these field values when
forwarding a message.

Amusingly, in the next paragraph, the Set-Cookie headers behavior that you mention is explicitly called out as non-compliant, but is a widely-used violation that -in practice- requires special casing.

[0] https://tools.ietf.org/html/rfc7230#section-3.2.2

@davoclavo
Copy link

I agree with the fact that multiple headers (except Set-Cookie headers) could be sent as a comma separated list under the same header entry. However, for the sake of convention/compatibility with gun and handling that edge case with cookies, I'd say supporting both maps/proplist as headers should be allowed.

This is a related issue I submitted a couple days ago: #125

tothlac added a commit to tothlac/shotgun that referenced this issue Dec 8, 2015
tothlac added a commit to tothlac/shotgun that referenced this issue Dec 14, 2015
tothlac added a commit to tothlac/shotgun that referenced this issue Dec 14, 2015
jfacorro added a commit that referenced this issue Dec 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants