aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-09-30 11:02:08 +1000
committerAldo Cortesi <aldo@nullcube.com>2016-09-30 11:02:08 +1000
commit6d1f036021cde61e42891091546a29612d7d9a45 (patch)
treed8d36a889b9da3e8b970aa98eecd202e2cf98b82 /mitmproxy
parent825b0917bd7a7b68ff5ead4a6effd1e4b499756b (diff)
parentd068000f16cb44b7277de04ba20bd1fc62e4a956 (diff)
downloadmitmproxy-6d1f036021cde61e42891091546a29612d7d9a45.tar.gz
mitmproxy-6d1f036021cde61e42891091546a29612d7d9a45.tar.bz2
mitmproxy-6d1f036021cde61e42891091546a29612d7d9a45.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/protocol/http.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py
index e1487943..d3e3c80f 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: