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

Expunge user:pass@... from Host header.

In verbose mode, the basic auth user and password would show up in colored
output reporting the Host header, as reported in
https://github.com/jkbr/httpie/issues/169
This commit is contained in:
Jason Dusek
2014-01-06 18:39:11 +00:00
parent 6af42b1827
commit 5a037b2e13

View File

@@ -155,7 +155,7 @@ class HTTPRequest(HTTPMessage):
headers = dict(self._orig.headers) headers = dict(self._orig.headers)
if 'Host' not in headers: if 'Host' not in headers:
headers['Host'] = url.netloc headers['Host'] = url.netloc.split('@')[-1]
headers = ['%s: %s' % (name, value) headers = ['%s: %s' % (name, value)
for name, value in headers.items()] for name, value in headers.items()]