From fe99871df873f755ef5f4770edf37304f88102d7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 21 Feb 2011 11:08:35 +1300 Subject: Add --kill option to mitmdump If this option is passed all requests that are not part of a replayed conversation are killed. If the option is not passed, such requests are passed through to the server as usual. --- libmproxy/flow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libmproxy/flow.py') diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 4025a30d..996b45cd 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -44,9 +44,10 @@ class ServerPlaybackState: chronological order. """ for i in flows: - h = self._hash(i) - l = self.fmap.setdefault(self._hash(i), []) - l.append(i) + if i.response: + h = self._hash(i) + l = self.fmap.setdefault(self._hash(i), []) + l.append(i) def _hash(self, flow): """ -- cgit v1.2.3