mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Merge pull request #3826 from BlownSnail/fixing
Fix wrong behavior of --allow-hosts options
This commit is contained in:
commit
cc5fa2d0ef
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user