From 4a2ca7563108d2256909309c770feb0c5b481397 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 15 May 2022 22:18:30 +0200 Subject: [PATCH] remove overambitious assertion found with fuzzing, fix #5343 (#5352) --- mitmproxy/proxy/layers/http/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mitmproxy/proxy/layers/http/__init__.py b/mitmproxy/proxy/layers/http/__init__.py index 10516b653..2af8aefb7 100644 --- a/mitmproxy/proxy/layers/http/__init__.py +++ b/mitmproxy/proxy/layers/http/__init__.py @@ -910,10 +910,9 @@ class HttpLayer(layer.Layer): try: stream = self.streams[command.event.stream_id] except KeyError: - # We may be getting errors for a specific stream even though we've already finished handling it. - assert isinstance( - command.event, (RequestProtocolError, ResponseProtocolError) - ) + # We may be getting data or errors for a stream even though we've already finished handling it, + # see for example https://github.com/mitmproxy/mitmproxy/issues/5343. + pass else: yield from self.event_to_child(stream, command.event) elif isinstance(command, SendHttp):