mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-28 12:15:00 +08:00
fix host header modification, refs #1571
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user