Merge pull request #667 from spladug/proxy-protocol-allow-star

proxy_allow_ips: Allow proxy protocol if "*" specified.
This commit is contained in:
Benoit Chesneau 2013-12-26 02:57:47 -08:00
commit 5625dbcfcd
2 changed files with 6 additions and 1 deletions

View File

@ -1408,6 +1408,10 @@ class ProxyAllowFrom(Setting):
default = "127.0.0.1" default = "127.0.0.1"
desc = """\ desc = """\
Front-end's IPs from which allowed accept proxy requests (comma separate). 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: if e.args[0] == ENOTCONN:
raise ForbiddenProxyRequest("UNKNOW") raise ForbiddenProxyRequest("UNKNOW")
raise 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) raise ForbiddenProxyRequest(remote_host)
def parse_proxy_protocol(self, line): def parse_proxy_protocol(self, line):