From 0a6e3c88ef154a30b089d7bd2736284854e45af3 Mon Sep 17 00:00:00 2001 From: Anant Date: Mon, 25 Jan 2016 19:00:33 +0530 Subject: [PATCH 1/2] Added feature to intercept flows from within inline scripts --- libmproxy/console/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 0df10256d..9b0250e79 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -702,7 +702,10 @@ class ConsoleMaster(flow.FlowMaster): self.state.intercept) and not f.request.is_replay: f.intercept(self) else: - f.reply() + if f.intercepted: + f.intercept(self) + else: + f.reply() signals.flowlist_change.send(self) signals.flow_change.send(self, flow = f) @@ -732,4 +735,4 @@ class ConsoleMaster(flow.FlowMaster): if super(ConsoleMaster, self).handle_script_change(script): signals.status_message.send(message='"{}" reloaded.'.format(script.filename)) else: - signals.status_message.send(message='Error reloading "{}".'.format(script.filename)) \ No newline at end of file + signals.status_message.send(message='Error reloading "{}".'.format(script.filename)) From 34875585c05301c02da4a945e0226333f3fbadf7 Mon Sep 17 00:00:00 2001 From: Anant Date: Sun, 31 Jan 2016 04:02:11 +0530 Subject: [PATCH 2/2] added comments --- libmproxy/console/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 9b0250e79..3d0fb1aa5 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -702,6 +702,7 @@ class ConsoleMaster(flow.FlowMaster): self.state.intercept) and not f.request.is_replay: f.intercept(self) else: + #check if flow was intercepted within an inline script by flow.intercept() if f.intercepted: f.intercept(self) else: