mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 02:10:59 +00:00
override host header in reverse proxy mode, refs #1571
This commit is contained in:
parent
ebccc103d8
commit
1a762cdce5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user