remove overambitious assertion found with fuzzing, fix #5343 (#5352)

This commit is contained in:
Maximilian Hils 2022-05-15 22:18:30 +02:00 committed by GitHub
parent 4069830d48
commit 4a2ca75631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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):