From ce1afd79e69e35b81a6f0d02fbd7ae04af59f9d6 Mon Sep 17 00:00:00 2001 From: Cromfel Date: Wed, 27 Jul 2022 13:34:07 +0300 Subject: [PATCH] Support optional payloads in msgpack implementation (#981) --- src/socketio/msgpack_packet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socketio/msgpack_packet.py b/src/socketio/msgpack_packet.py index cb6afe8..2746263 100644 --- a/src/socketio/msgpack_packet.py +++ b/src/socketio/msgpack_packet.py @@ -13,6 +13,6 @@ class MsgPackPacket(packet.Packet): """Decode a transmitted package.""" decoded = msgpack.loads(encoded_packet) self.packet_type = decoded['type'] - self.data = decoded['data'] + self.data = decoded.get('data') self.id = decoded.get('id') self.namespace = decoded['nsp']