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

Multiple headers with same name should be treated as a list #224

Closed
rahmansyed opened this issue Jan 20, 2014 · 10 comments
Closed

Multiple headers with same name should be treated as a list #224

rahmansyed opened this issue Jan 20, 2014 · 10 comments
Labels
Milestone

Comments

@rahmansyed
Copy link
Contributor

I'd like to submit for consideration handling of multiple HTTP headers with the same name. Currently, it appears that falcon is selecting one of the values while discarding the remainder.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

Multiple message-header fields with the same field-name MAY be present in a 
message if and only if the entire field-value for that header field is defined as a comma-
separated list [i.e., #(values)]. It MUST be possible to combine the multiple header 
fields into one "field-name: field-value" pair, without changing the semantics of the 
message, by appending each subsequent field-value to the first, each separated by a 
comma.

In particular, this issue is arising with a newer version of Repose which splits any of its internal headers that are comma delimited.

@kgriffs kgriffs added the bug label Mar 17, 2014
@kgriffs kgriffs modified the milestone: 0.2 Mar 17, 2014
@kgriffs kgriffs self-assigned this Mar 27, 2014
@kgriffs
Copy link
Member

kgriffs commented Mar 27, 2014

The trick with this is doing it in an efficient way. Let me take a stab at it.

@kgriffs
Copy link
Member

kgriffs commented Mar 27, 2014

@rsyed83 You are talking specifically about accessing multiple headers from the req object, right?

@kgriffs
Copy link
Member

kgriffs commented Mar 27, 2014

OK, so I looked into this and not sure why I didn't think of this off the bat, but the WSGI environ is a dict, and so it cannot hold duplicate header names in it. I tested wsgiref, gunicorn, and uwsgi. The first two combined the duplicate header lines into a comma-delimited string. However, uwsgi only retained the last headervalue.

@rsyed83 Are you running uwsgi?

@jarretraim
Copy link

@kgriffs We are running uwsgi in barbican and we're seeing this too. Seems like it might be their bug?

@rahmansyed
Copy link
Contributor Author

@kgriffs yeah we're using uwsgi as well. Thanks for looking into it from the falcon perspective, didn't realize it'd be something handled in the layer above.

@kgriffs
Copy link
Member

kgriffs commented Mar 27, 2014

Glad to help! Please let me know if you are able to confirm this is a uwsgi bug.

@jfwood
Copy link

jfwood commented Mar 31, 2014

I'll ask the uWSGI list about this one.

@jfwood
Copy link

jfwood commented Mar 31, 2014

Per ever-responsive Robert De Ioris with uWSGI:

This patch adds support for combining headers when in native http mode:
unbit/uwsgi@8a032b4

Regarding when this patch might be released, he mentioned:
We have 2 bugs still opened, once fixed we will release 2.0.4. If all goes
well it should happen in a couple of days.

@kgriffs
Copy link
Member

kgriffs commented Mar 31, 2014

Cool, thanks for following up with the uWSGI folks!

@kgriffs
Copy link
Member

kgriffs commented Apr 15, 2014

Closing this bug since it isn't Falcon's.

@kgriffs kgriffs closed this as completed Apr 15, 2014
@kgriffs kgriffs removed their assignment Oct 12, 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