mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #426 from mpaolini/marco_develop
allow bypassing of forwarded_allow_ips check
This commit is contained in:
commit
af473a8b43
@ -706,6 +706,10 @@ class ForwardedAllowIPS(Setting):
|
||||
desc = """\
|
||||
Front-end's IPs from which allowed to handle X-Forwarded-* headers.
|
||||
(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)
|
||||
"""
|
||||
|
||||
class AccessLog(Setting):
|
||||
|
||||
@ -85,7 +85,8 @@ def create(req, sock, client, server, cfg):
|
||||
|
||||
secure_headers = cfg.secure_scheme_headers
|
||||
x_forwarded_for_header = cfg.x_forwarded_for_header
|
||||
if client and client[0] not in cfg.forwarded_allow_ips:
|
||||
if '*' not in cfg.forwarded_allow_ips and client\
|
||||
and client[0] not in cfg.forwarded_allow_ips:
|
||||
x_forwarded_for_header = None
|
||||
secure_headers = {}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user