diff options
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r-- | Lib/http/client.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index e4a9c07..d1d2bb9 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -602,7 +602,11 @@ class HTTPResponse(io.RawIOBase): def getheader(self, name, default=None): if self.headers is None: raise ResponseNotReady() - return ', '.join(self.headers.get_all(name, default)) + headers = self.headers.get_all(name) or default + if isinstance(headers, str) or not hasattr(headers, '__iter__'): + return headers + else: + return ', '.join(headers) def getheaders(self): """Return list of (header, value) tuples.""" |