mirror of
https://github.com/httpie/cli.git
synced 2024-11-25 09:13:25 +01:00
Made sure request Host is correct when printing.
This commit is contained in:
parent
5e19e1b95d
commit
ed888a2657
@ -55,7 +55,8 @@ def make_request_message(request):
|
|||||||
"""Make an `HTTPMessage` from `requests.models.Request`."""
|
"""Make an `HTTPMessage` from `requests.models.Request`."""
|
||||||
url = urlparse(request.url)
|
url = urlparse(request.url)
|
||||||
request_headers = dict(request.headers)
|
request_headers = dict(request.headers)
|
||||||
request_headers['Host'] = url.netloc
|
if 'Host' not in request_headers:
|
||||||
|
request_headers['Host'] = url.netloc
|
||||||
return HTTPMessage(
|
return HTTPMessage(
|
||||||
line='{method} {path} HTTP/1.1'.format(
|
line='{method} {path} HTTP/1.1'.format(
|
||||||
method=request.method,
|
method=request.method,
|
||||||
|
Loading…
Reference in New Issue
Block a user