Skip to content

Commit

Permalink
additional fix regarding bytearray support
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jan 18, 2017
1 parent 4f25274 commit 268e3cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engineio/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def decode(self, encoded_packet):
b64 = False
if not isinstance(encoded_packet, binary_types):
encoded_packet = encoded_packet.encode('utf-8')
elif not isinstance(encoded_packet, bytes):
encoded_packet = bytes(encoded_packet)
self.packet_type = six.byte2int(encoded_packet[0:1])
if self.packet_type == 98: # 'b' --> binary base64 encoded packet
self.binary = True
Expand Down

0 comments on commit 268e3cb

Please sign in to comment.