You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Fixed Content-Type retrieval for Python 3.
This commit is contained in:
@@ -87,7 +87,13 @@ class HTTPMessage(object):
|
||||
@property
|
||||
def content_type(self):
|
||||
"""Return the message content type."""
|
||||
ct = self._orig.headers.get('Content-Type', '')
|
||||
ct = self._orig.headers.get(
|
||||
b'Content-Type',
|
||||
self._orig.headers.get(
|
||||
'Content-Type',
|
||||
''
|
||||
)
|
||||
)
|
||||
if isinstance(ct, bytes):
|
||||
ct = ct.decode()
|
||||
return ct
|
||||
|
Reference in New Issue
Block a user