From 8c9c6d965b5bccb1645543313a29314a9a8c907e Mon Sep 17 00:00:00 2001 From: Alexander Prinzhorn Date: Fri, 9 Jul 2021 17:42:27 +0200 Subject: [PATCH] fix forward empty ws messages --- mitmproxy/proxy/layers/websocket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitmproxy/proxy/layers/websocket.py b/mitmproxy/proxy/layers/websocket.py index 5e78c2267..63430d531 100644 --- a/mitmproxy/proxy/layers/websocket.py +++ b/mitmproxy/proxy/layers/websocket.py @@ -228,8 +228,8 @@ class Fragmentizer: def __call__(self, content: bytes) -> Iterator[wsproto.events.Message]: if not content: - return - if len(content) == sum(self.fragment_lengths): + yield self.msg(content, True) + elif len(content) == sum(self.fragment_lengths): # message has the same length, we can reuse the same sizes offset = 0 for fl in self.fragment_lengths[:-1]: