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

Fixed and added tests for --verbose with unicode headers.

This commit is contained in:
Jakub Roztocil
2014-04-26 20:10:15 +02:00
parent eca1ffaedb
commit 43bc6d0c98
2 changed files with 40 additions and 4 deletions

View File

@@ -180,8 +180,12 @@ class HTTPRequest(HTTPMessage):
for name, value in headers.items()]
headers.insert(0, request_line)
headers = '\r\n'.join(headers).strip()
return '\r\n'.join(headers).strip()
if isinstance(headers, bytes):
# Python < 3
headers = headers.decode('utf8')
return headers
@property
def encoding(self):