diff --git a/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py b/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py index 07d833730..ce704eaa8 100644 --- a/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py +++ b/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py @@ -203,7 +203,9 @@ async def _read_frame(self): if has_mask: # pragma: no cover mask = await self.reader.read(4) - payload = await self.reader.read(length) + payload = b"" + while len(payload) < length: + payload += await self.reader.read(length) if has_mask: # pragma: no cover payload = bytes(x ^ mask[i % 4] for i, x in enumerate(payload)) return opcode, payload