From b7c22157dd022ab0c1c06fb14d7059fffff12996 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 13 Dec 2018 02:57:21 +0800 Subject: [PATCH] verify: fix cdnlist logic --- cdn-testlist.txt | 2 ++ verify.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cdn-testlist.txt b/cdn-testlist.txt index e69de29bb2..d4b884a7ab 100644 --- a/cdn-testlist.txt +++ b/cdn-testlist.txt @@ -0,0 +1,2 @@ +www.azure.cn.mschcdn.com +www.gov.cn \ No newline at end of file diff --git a/verify.py b/verify.py index 00a22d2f6f..c05dc160e1 100755 --- a/verify.py +++ b/verify.py @@ -24,7 +24,7 @@ except: with open("accelerated-domains.china.raw.txt") as f: domains = random.sample([line.rstrip('\n') for line in f], 100) - # domains = [line.rstrip('\n') for line in f][46389:46400] + # domains = [line.rstrip('\n') for line in f][13820:13830] def cn_ip_test(domain): @@ -56,7 +56,10 @@ for domain in domains: if any(i in nameserver_text for i in whitelist): print(colored("NS Whitelist matched for domain: " + domain, "green")) elif domain.count(".") > 1 or any(testdomain.endswith(domain) for testdomain in cdnlist): - if testdomain is None: + for testdomain in cdnlist: + if testdomain.endswith(domain): + break + else: testdomain = domain if chnroutes: try: