From ca7ca8ec248d2a213622a9d2dca1a192f65365c2 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 17 Jul 2016 11:06:29 +1200 Subject: [PATCH] The "handled" flag on responses should not persist across calls --- mitmproxy/controller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mitmproxy/controller.py b/mitmproxy/controller.py index 54d75e6b7..070ec8620 100644 --- a/mitmproxy/controller.py +++ b/mitmproxy/controller.py @@ -220,6 +220,12 @@ def handler(f): if handling and not message.reply.acked and not message.reply.taken: message.reply.ack() + + # Reset the handled flag - it's common for us to feed the same object + # through handlers repeatedly, so we don't want this to persist across + # calls. + if message.reply.handled: + message.reply.handled = False return ret # Mark this function as a handler wrapper wrapper.__dict__["__handler"] = True