1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Python 3 unicode fixes.

This commit is contained in:
Jakub Roztocil
2014-04-26 17:16:11 +02:00
parent 8ec32fe7f3
commit 467d126b6c
7 changed files with 25 additions and 22 deletions

View File

@@ -104,7 +104,10 @@ class HTTPMessage(object):
@property
def content_type(self):
"""Return the message content type."""
return self._orig.headers.get('Content-Type', '')
ct = self._orig.headers.get('Content-Type', '')
if not isinstance(ct, str):
ct = ct.decode('utf8')
return ct
class HTTPResponse(HTTPMessage):