From 5d568708188086c6deb747bee4365552483b6807 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 7 Feb 2015 19:33:36 +0100 Subject: disable replay from ui for live flows --- libmproxy/flow.py | 2 ++ test/test_flow.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libmproxy/flow.py b/libmproxy/flow.py index dd9900e9..49ec5a0b 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -828,6 +828,8 @@ class FlowMaster(controller.Master): """ Returns None if successful, or error message if not. """ + if f.live and run_scripthooks: + return "Can't replay live request." if f.intercepted: return "Can't replay while intercepting..." if f.request.content == http.CONTENT_MISSING: diff --git a/test/test_flow.py b/test/test_flow.py index d11d47fa..6d77f075 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -666,6 +666,9 @@ class TestFlowMaster: f.intercepted = True assert "intercepting" in fm.replay_request(f) + f.live = True + assert "live" in fm.replay_request(f, run_scripthooks=True) + def test_script_reqerr(self): s = flow.State() fm = flow.FlowMaster(None, s) -- cgit v1.2.3