Skip to content

Commit 78d8233

Browse files
committed
chore: implicit raw and use_bin_type flags for consistency
1 parent 7a2e014 commit 78d8233

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ably/transport/websockettransport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ async def ws_read_loop(self):
206206

207207
def decode_raw_websocket_frame(self, raw: str | bytes) -> dict:
208208
if self.format == 'msgpack':
209-
return msgpack.unpackb(raw)
209+
return msgpack.unpackb(raw, raw=False)
210210
return json.loads(raw)
211211

212212
def on_protcol_message_handled(self, task):
@@ -247,7 +247,7 @@ async def send(self, message: dict):
247247
raise Exception()
248248
# Encode based on format
249249
if self.format == 'msgpack':
250-
raw_msg = msgpack.packb(message)
250+
raw_msg = msgpack.packb(message, use_bin_type=True)
251251
log.info(f'WebSocketTransport.send(): sending msgpack message (length: {len(raw_msg)} bytes)')
252252
else:
253253
raw_msg = json.dumps(message)

0 commit comments

Comments
 (0)