proxy_allow_ips: Allow proxy protocol if "*" specified.

This makes proxy_allow_ips symmetrical with forwarded_allow_ips and is
useful in the same situations.
This commit is contained in:
Neil Williams 2013-12-17 13:45:30 -08:00
parent 69ab24b589
commit 9d9e547316
2 changed files with 6 additions and 1 deletions

View File

@ -1403,6 +1403,10 @@ class ProxyAllowFrom(Setting):
default = "127.0.0.1"
desc = """\
Front-end's IPs from which allowed accept proxy requests (comma separate).
Set to "*" to disable checking of Front-end IPs (useful for setups
where you don't know in advance the IP address of Front-end, but
you still trust the environment)
"""

View File

@ -252,7 +252,8 @@ class Request(Message):
if e.args[0] == ENOTCONN:
raise ForbiddenProxyRequest("UNKNOW")
raise
if remote_host not in self.cfg.proxy_allow_ips:
if ("*" not in self.cfg.proxy_allow_ips and
remote_host not in self.cfg.proxy_allow_ips):
raise ForbiddenProxyRequest(remote_host)
def parse_proxy_protocol(self, line):