1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Made sure request Host is correct when printing.

This commit is contained in:
Jakub Roztocil 2012-03-14 01:10:28 +01:00
parent 5e19e1b95d
commit ed888a2657

View File

@ -55,7 +55,8 @@ def make_request_message(request):
"""Make an `HTTPMessage` from `requests.models.Request`."""
url = urlparse(request.url)
request_headers = dict(request.headers)
request_headers['Host'] = url.netloc
if 'Host' not in request_headers:
request_headers['Host'] = url.netloc
return HTTPMessage(
line='{method} {path} HTTP/1.1'.format(
method=request.method,