-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pyramid's request derives from WebOb's request, and uses its
EnvironHeaders. That class has the following docstring:
"""An object that represents the headers as present in a
WSGI environment.
This object is a wrapper (with no internal state) for a WSGI
request object, representing the CGI-style HTTP_* keys as a
dictionary. Because a CGI environment can only hold one value for
each key, this dictionary is single-valued (unlike outgoing
headers).
"""
So, you don't get access to the "raw" values, only what your front-end
WSGI server morphs into the CGI environment. As it happens, waitress
does exactly what you want, in conformance with RFC 2616[1], which says:
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. The order in which header fields with the
same field-name are received is therefore significant to the
interpretation of the combined field value, and thus a proxy MUST
NOT change the order of these field values when a message is
forwarded.
The CGI spec[2] says:
If multiple headers with the same field-name are received then they
must be rewritten as a single header having the same semantics.
Similarly, a header that is received on more than one line must be
merged onto a single line. The server must, if necessary, change
the representation of the data (for example, the character set) to
be appropriate for a CGI environment variable.
[1]
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
[2]
http://tools.ietf.org/html/draft-robinson-www-interface-00
Tres.
- --
===================================================================
Tres Seaver
+1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design"
http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAlR6QRoACgkQ+gerLs4ltQ40aQCgqNocth024ptXPvMbaVGtCjn9
JpIAnRwYPrvI+KGsgy2K9TftqVwrgZmo
=/2Lg
-----END PGP SIGNATURE-----