From 6398dc308a85fb3e42aaeb09ae311c05afe92daa Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 22 Nov 2021 07:41:33 +0100 Subject: [PATCH] WebSockets: don't assert that server is connected upon initialization (#4932) there may already have been a disconnect, which is still in the processing queue. fix #4931 --- mitmproxy/proxy/layers/websocket.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mitmproxy/proxy/layers/websocket.py b/mitmproxy/proxy/layers/websocket.py index b616eb940..16cbf657f 100644 --- a/mitmproxy/proxy/layers/websocket.py +++ b/mitmproxy/proxy/layers/websocket.py @@ -86,7 +86,6 @@ class WebsocketLayer(layer.Layer): def __init__(self, context: Context, flow: http.HTTPFlow): super().__init__(context) self.flow = flow - assert context.server.connected @expect(events.Start) def start(self, _) -> layer.CommandGenerator[None]: