aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/flow.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-12-23 20:33:42 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-12-23 20:33:42 +0100
commit2861d99de4d329bcba0a3c2193523398a22673c0 (patch)
tree0aa1a2aae666c2909285a6fd5049f2ef7d6d8ebc /libmproxy/flow.py
parent459772a8ef79ac0adeaeba56577972e86074265e (diff)
downloadmitmproxy-2861d99de4d329bcba0a3c2193523398a22673c0.tar.gz
mitmproxy-2861d99de4d329bcba0a3c2193523398a22673c0.tar.bz2
mitmproxy-2861d99de4d329bcba0a3c2193523398a22673c0.zip
web: intercept feature
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r--libmproxy/flow.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index 26699cc7..34c7a753 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -494,9 +494,9 @@ class FlowStore(FlowList):
return c
# TODO: Should accept_all operate on views or on all flows?
- def accept_all(self):
+ def accept_all(self, master):
for f in self._list:
- f.accept_intercept()
+ f.accept_intercept(master)
def kill_all(self, master):
for f in self._list:
@@ -574,8 +574,8 @@ class State(object):
def clear(self):
self.flows._clear()
- def accept_all(self):
- self.flows.accept_all()
+ def accept_all(self, master):
+ self.flows.accept_all(master)
def revert(self, f):
f.revert()
@@ -811,7 +811,7 @@ class FlowMaster(controller.Master):
"""
if f.live:
return "Can't replay request which is still live..."
- if f.intercepting:
+ if f.intercepted:
return "Can't replay while intercepting..."
if f.request.content == http.CONTENT_MISSING:
return "Can't replay request with missing content..."
@@ -902,6 +902,12 @@ class FlowMaster(controller.Master):
self.stream.add(f)
return f
+ def handle_intercept(self, f):
+ self.state.update_flow(f)
+
+ def handle_accept_intercept(self, f):
+ self.state.update_flow(f)
+
def shutdown(self):
self.unload_scripts()
controller.Master.shutdown(self)