Merge pull request #1 from michieldwitte/master

If the payload type is an octet-stream don't parse it as utf-8
This commit is contained in:
Giacomo Tanganelli 2018-01-29 11:07:11 +01:00 committed by GitHub
commit 9f608e46ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,10 @@ class Serializer(object):
raise AttributeError("Packet length %s, pos %s" % (length_packet, pos))
message.payload = ""
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)
return message