override host header in reverse proxy mode, refs #1571

This commit is contained in:
Maximilian Hils 2016-09-26 18:03:18 -07:00
parent ebccc103d8
commit 1a762cdce5

View File

@ -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