Fix message.payload_type
This commit is contained in:
parent
9f608e46ea
commit
418143f9df
1 changed files with 6 additions and 3 deletions
|
@ -113,10 +113,13 @@ class Serializer(object):
|
|||
raise AttributeError("Packet length %s, pos %s" % (length_packet, pos))
|
||||
message.payload = ""
|
||||
payload = values[pos:]
|
||||
try:
|
||||
if message.payload_type == defines.Content_types["application/octet-stream"]:
|
||||
message.payload = payload
|
||||
else:
|
||||
message.payload = payload.decode("utf-8")
|
||||
except AttributeError:
|
||||
message.payload = payload.decode("utf-8")
|
||||
pos += len(payload)
|
||||
|
||||
return message
|
||||
|
|
Loading…
Reference in a new issue