diff options
Diffstat (limited to 'mitmproxy/tools/web/master.py')
-rw-r--r-- | mitmproxy/tools/web/master.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index 619582f3..e95daf44 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -9,6 +9,7 @@ from typing import Optional from mitmproxy import addons from mitmproxy import controller from mitmproxy import exceptions +from mitmproxy import flowfilter from mitmproxy.addons import state from mitmproxy import options from mitmproxy import master @@ -94,8 +95,9 @@ class WebState(state.State): class Options(options.Options): def __init__( self, + *, # all args are keyword-only. intercept: Optional[str] = None, - wdebug: bool = bool, + wdebug: bool = False, wport: int = 8081, wiface: str = "127.0.0.1", wauthenticator: Optional[authentication.PassMan] = None, @@ -178,8 +180,12 @@ class WebMaster(master.Master): self.shutdown() def _process_flow(self, f): - if self.state.intercept and self.state.intercept( - f) and not f.request.is_replay: + should_intercept = ( + self.state.intercept and flowfilter.match(self.state.intercept, f) + and not f.request.is_replay + and f.reply.state == "handled" + ) + if should_intercept: f.intercept(self) return f |