aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools/web/master.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2016-10-27 08:26:48 +1300
committerGitHub <noreply@github.com>2016-10-27 08:26:48 +1300
commit72ac572226ec76a44cfe2b981ce6bd1bce6ab69a (patch)
tree306c1efea78a2b51c5f253692d212aee26297fef /mitmproxy/tools/web/master.py
parentd096b36068f744af2ac490b5cac931f3ddf30b5e (diff)
parentbb5811beec44df1c9e28e6060df12a82ac81864a (diff)
downloadmitmproxy-72ac572226ec76a44cfe2b981ce6bd1bce6ab69a.tar.gz
mitmproxy-72ac572226ec76a44cfe2b981ce6bd1bce6ab69a.tar.bz2
mitmproxy-72ac572226ec76a44cfe2b981ce6bd1bce6ab69a.zip
Merge pull request #1673 from mhils/issue-1620
fix #1620
Diffstat (limited to 'mitmproxy/tools/web/master.py')
-rw-r--r--mitmproxy/tools/web/master.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py
index 75842422..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
@@ -179,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