Merge pull request #3826 from BlownSnail/fixing

Fix wrong behavior of --allow-hosts options
This commit is contained in:
Maximilian Hils 2020-02-26 11:52:45 +01:00 committed by GitHub
commit cc5fa2d0ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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