WebSocket error when handling PING packet (Fixes #129)

This commit is contained in:
Miguel Grinberg
2023-04-14 15:29:26 +01:00
parent bb75e15b2d
commit 87cd098f66
2 changed files with 2 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ class WebSocket(BaseWebSocket):
opcode, payload = await self._read_frame()
send_opcode, data = self._process_websocket_frame(opcode, payload)
if send_opcode: # pragma: no cover
await self.send(send_opcode, data)
await self.send(data, send_opcode)
elif data: # pragma: no branch
return data

View File

@@ -28,7 +28,7 @@ class WebSocket:
opcode, payload = self._read_frame()
send_opcode, data = self._process_websocket_frame(opcode, payload)
if send_opcode: # pragma: no cover
self.send(send_opcode, data)
self.send(data, send_opcode)
elif data: # pragma: no branch
return data