summaryrefslogtreecommitdiff
path: root/paste/response.py
diff options
context:
space:
mode:
authorcce <devnull@localhost>2005-12-26 06:39:30 +0000
committercce <devnull@localhost>2005-12-26 06:39:30 +0000
commit9c4ee3831cd606f2a9c0a23ded20f356db3100c2 (patch)
tree6318647da97100ec65d83e5000701c8bc58ae12f /paste/response.py
parenta438d9ab87e23a55b6c73f6919c6c696e2d0ba0b (diff)
downloadpaste-9c4ee3831cd606f2a9c0a23ded20f356db3100c2.tar.gz
- added normalize_headers to paste.httpheaders which sorts a set
of outgoing headers and capitalizes them to exactly match the RFC for extremely dumb user agents (which exist... unfortunately) that don't do case-insensitive matches and assume Camel-Case - added ResponseHeaderWrapper to use python properties to access headers which don't use multiple-entities (like Set-Cookie) - updated comment to header_value to explain why , separator works in most cases (but not all)
Diffstat (limited to 'paste/response.py')
-rw-r--r--paste/response.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/paste/response.py b/paste/response.py
index 4362d67..9547db8 100644
--- a/paste/response.py
+++ b/paste/response.py
@@ -80,7 +80,17 @@ def header_value(headers, name):
"""
Returns the header's value, or None if no such header. If a
header appears more than once, all the values of the headers
- are joined with ','
+ are joined with ','. Note that this is consistent /w RFC 2616
+ section 4.2 which states:
+
+ 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.
+
+ However, note that the original netscape usage of 'Set-Cookie',
+ especially in MSIE which contains an 'expires' date will is not
+ compatible with this particular concatination method.
"""
name = name.lower()
result = [value for header, value in headers