From 56ab9c70b577a7de655786b3ea89f551503c02dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Sat, 10 Sep 2011 22:07:56 +0200 Subject: [PATCH] Ensure that the payload parts in decode_hybi consist of bytes. --- websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/websocket.py b/websocket.py index ec69ba6..72874e9 100644 --- a/websocket.py +++ b/websocket.py @@ -312,7 +312,7 @@ Sec-WebSocket-Accept: %s\r offset=full_len - (f['length'] % 4), count=(f['length'] % 4)) c = numpy.bitwise_xor(data, mask).tostring() - f['payload'] = b + s2b(c) + f['payload'] = s2b(b) + s2b(c) else: print("Unmasked frame: %s" % repr(buf)) f['payload'] = buf[(f['hlen'] + has_mask * 4):full_len]