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

Run tests against local httpbin instance via pytest-httpbin.

This commit is contained in:
Jakub Roztocil
2014-06-28 16:35:57 +02:00
parent 79329ed1c6
commit 2a72ae23d5
19 changed files with 300 additions and 263 deletions

View File

@@ -105,8 +105,13 @@ class HTTPRequest(HTTPMessage):
if 'Host' not in self._orig.headers:
headers['Host'] = url.netloc.split('@')[-1]
headers = ['%s: %s' % (name, value)
for name, value in headers.items()]
headers = [
'%s: %s' % (
name,
value if isinstance(value, str) else value.decode('utf8')
)
for name, value in headers.items()
]
headers.insert(0, request_line)
headers = '\r\n'.join(headers).strip()