diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-09-26 18:03:18 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-09-26 22:30:01 -0700 |
commit | 1a762cdce56f57b74ed3b5de74e1dc11be6fc812 (patch) | |
tree | 7f84309a40be91b69b789440a8b5590b78887fec | |
parent | ebccc103d83959123d39efe6803a9c24b7da0951 (diff) | |
download | mitmproxy-1a762cdce56f57b74ed3b5de74e1dc11be6fc812.tar.gz mitmproxy-1a762cdce56f57b74ed3b5de74e1dc11be6fc812.tar.bz2 mitmproxy-1a762cdce56f57b74ed3b5de74e1dc11be6fc812.zip |
override host header in reverse proxy mode, refs #1571
-rw-r--r-- | mitmproxy/protocol/http.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index 894ae465..e1487943 100644 --- a/mitmproxy/protocol/http.py +++ b/mitmproxy/protocol/http.py @@ -184,6 +184,10 @@ class HttpLayer(base.Layer): self.channel.ask("error", flow) return + # update host header in reverse proxy mode + if self.mode == "reverse": + 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: flow.request.headers["Proxy-Authorization"] = self.config.upstream_auth |