From dfcfa6263cd8d2208155a45d35ef4434dc967be2 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 27 Mar 2016 13:15:57 +0200 Subject: add safeguard --- mitmproxy/protocol/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index 22e71422..56c5f9ea 100644 --- a/mitmproxy/protocol/http.py +++ b/mitmproxy/protocol/http.py @@ -231,7 +231,8 @@ class HttpLayer(Layer): six.reraise(ProtocolException, ProtocolException( "Error in HTTP connection: %s" % repr(e)), sys.exc_info()[2]) finally: - flow.live = False + if flow: + flow.live = False def get_request_from_client(self): request = self.read_request() -- cgit v1.2.3