From 5a037b2e13813b0200a69eaec28f6c47a0f3a079 Mon Sep 17 00:00:00 2001 From: Jason Dusek Date: Mon, 6 Jan 2014 18:39:11 +0000 Subject: [PATCH] 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 --- httpie/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpie/models.py b/httpie/models.py index 8da93c1d..682e4549 100644 --- a/httpie/models.py +++ b/httpie/models.py @@ -155,7 +155,7 @@ class HTTPRequest(HTTPMessage): headers = dict(self._orig.headers) if 'Host' not in headers: - headers['Host'] = url.netloc + headers['Host'] = url.netloc.split('@')[-1] headers = ['%s: %s' % (name, value) for name, value in headers.items()]