From e0cd33b5863cebb78c38873e32540ee4c495ec15 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 27 Sep 2016 16:07:22 -0700 Subject: [PATCH 1/2] fix host header modification, refs #1571 --- mitmproxy/protocol/http.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index e14879436..d3e3c80f6 100644 --- a/mitmproxy/protocol/http.py +++ b/mitmproxy/protocol/http.py @@ -185,8 +185,11 @@ class HttpLayer(base.Layer): return # update host header in reverse proxy mode - if self.mode == "reverse": - flow.request.headers["Host"] = self.config.upstream_server.address.host + if self.config.options.mode == "reverse": + if six.PY2: + flow.request.headers["Host"] = self.config.upstream_server.address.host.encode() + else: + flow.request.headers["Host"] = self.config.upstream_server.address.host # set upstream auth if self.mode == "upstream" and self.config.upstream_auth is not None: From d068000f16cb44b7277de04ba20bd1fc62e4a956 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 28 Sep 2016 17:44:48 -0700 Subject: [PATCH 2/2] fix typo --- docs/certinstall.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/certinstall.rst b/docs/certinstall.rst index f5b92aeb1..68ad59cc5 100644 --- a/docs/certinstall.rst +++ b/docs/certinstall.rst @@ -135,7 +135,7 @@ mitmproxy. Mitmproxy then uses the provided certificate for interception of the specified domains instead of generating a certificate signed by its own CA. The certificate file is expected to be in the PEM format. You can include -intermediary certificates right below your leaf certificate, so that you PEM +intermediary certificates right below your leaf certificate, so that your PEM file roughly looks like this: .. code-block:: none