Fix wrong behavior of --allow-hosts options

This commit is contained in:
Blown_Snail 2020-02-23 15:06:13 +08:00
parent ff759fa51b
commit 0a296817d6

View File

@ -23,7 +23,7 @@ class HostMatcher:
if self.handle in ["ignore", "tcp"]:
return any(rex.search(host) for rex in self.regexes)
else: # self.handle == "allow"
return any(not rex.search(host) for rex in self.regexes)
return not any(rex.search(host) for rex in self.regexes)
def __bool__(self):
return bool(self.patterns)