diff options
author | Joe Gregorio <jcgregorio@google.com> | 2012-11-12 13:08:04 -0500 |
---|---|---|
committer | Joe Gregorio <jcgregorio@google.com> | 2012-11-12 13:08:04 -0500 |
commit | 20846977d470fc623dda0a08712954dbe4a34c7d (patch) | |
tree | 1a56107a20b4703b4a0fb24ce6be5d4a6e6ea760 /python3/httplib2/__init__.py | |
parent | 74b1d4a85cbf10e84b364bc17927f5420ae5d187 (diff) | |
download | httplib2-20846977d470fc623dda0a08712954dbe4a34c7d.tar.gz |
Fix Python3 dup header handling.
Fixes isse #229.
Diffstat (limited to 'python3/httplib2/__init__.py')
-rw-r--r-- | python3/httplib2/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py index fe5eb38..fb63594 100644 --- a/python3/httplib2/__init__.py +++ b/python3/httplib2/__init__.py @@ -24,7 +24,7 @@ __contributors__ = ["Thomas Broyer (t.broyer@ltgt.net)", "Louis Nyffenegger", "Mark Pilgrim"] __license__ = "MIT" -__version__ = "0.7.6" +__version__ = "0.7.7" import re import sys @@ -1322,8 +1322,12 @@ class Response(dict): # info is either an email.message or # an httplib.HTTPResponse object. if isinstance(info, http.client.HTTPResponse): - for key, value in info.getheaders(): - self[key.lower()] = value + for key, value in info.getheaders(): + key = key.lower() + prev = self.get(key) + if prev is not None: + value = ', '.join((prev, value)) + self[key] = value self.status = info.status self['status'] = str(self.status) self.reason = info.reason |