plack / psgi-specs

PSGI (Perl WSGI) specifications
http://plackperl.org/
133 stars 33 forks source link

Multiple HTTP header values #4

Closed eserte closed 14 years ago

eserte commented 14 years ago

I think the spec should say something about multiple values for HTTP values in the environment. As the spec states that values in the environment must be scalar strings, such values should probably be concatenated using commas, like suggested in RFC 2616.

miyagawa commented 14 years ago

Yes, it's covered in the FAQ:

Note that I'm talking about multiple header lines with the same key, and NOT about multiple header values (e.g. C<Accept: text/html, text/plain, *>). Joining the header values with C<, > is obviously the applications' job. LHTTP::Headers does exactly that when it's passed an array reference as a header value, for instance.

miyagawa commented 14 years ago

This is a very good point and indeed there were bugs in a couple of implementations, such as AnyEvent and ServerSimple: http://github.com/miyagawa/http-server-simple/commit/b505e06e2f00adf88feefecbc0cfa563aaa6713c

miyagawa commented 14 years ago

feedback merged.