If the payload type is an octet-stream don't parse it as utf-8
This commit is contained in:
parent
357b1afe4d
commit
a9ce746b21
1 changed files with 4 additions and 1 deletions
|
@ -113,7 +113,10 @@ class Serializer(object):
|
||||||
raise AttributeError("Packet length %s, pos %s" % (length_packet, pos))
|
raise AttributeError("Packet length %s, pos %s" % (length_packet, pos))
|
||||||
message.payload = ""
|
message.payload = ""
|
||||||
payload = values[pos:]
|
payload = values[pos:]
|
||||||
message.payload = payload.decode("utf-8")
|
if message.payload_type == defines.Content_types["application/octet-stream"]:
|
||||||
|
message.payload = payload
|
||||||
|
else:
|
||||||
|
message.payload = payload.decode("utf-8")
|
||||||
pos += len(payload)
|
pos += len(payload)
|
||||||
|
|
||||||
return message
|
return message
|
||||||
|
|
Loading…
Reference in a new issue