From c645a58263053d6897f1b13413419e575a65c66b Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Sun, 16 Aug 2020 19:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9EIP=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/iscdn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/iscdn.py b/modules/iscdn.py index d2bf347..c65c56e 100644 --- a/modules/iscdn.py +++ b/modules/iscdn.py @@ -40,7 +40,11 @@ def check_header_key(header): def check_cdn_cidr(content): ips = set(content.split(',')) for ip in ips: - ip = ipaddress.ip_address(ip) + try: + ip = ipaddress.ip_address(ip) + except Exception as e: + logger.log('DEBUG', e.args) + return False for cidr in cdn_ip_cidr: if ip in ipaddress.ip_network(cidr): return True