Also check for mapped IPv4 when checking trusted IPs

This commit is contained in:
Kovid Goyal 2023-12-18 11:59:50 +05:30
parent c5dec9241f
commit 2728790cf8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -145,6 +145,7 @@ def parse_trusted_ips(spec):
def is_ip_trusted(remote_addr, trusted_ips): def is_ip_trusted(remote_addr, trusted_ips):
remote_addr = getattr(remote_addr, 'ipv4_mapped', remote_addr)
for tip in trusted_ips: for tip in trusted_ips:
if hasattr(tip, 'hosts'): if hasattr(tip, 'hosts'):
if remote_addr in tip: if remote_addr in tip: