fix: [internal] Correct way to convert bytes to string if orjson exists

pull/1190/head
Jakub Onderka 2024-04-03 17:12:56 +02:00 committed by Jakub Onderka
parent 60aa6b9a0f
commit 4f6aace686
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta): # type: i
option |= orjson.OPT_INDENT_2
# orjson dumps method returns bytes instead of bytes, to keep compatibility with json
# we have to convert output to str
return str(dumps(self, default=pymisp_json_default, option=option))
return dumps(self, default=pymisp_json_default, option=option).decode()
return dumps(self, default=pymisp_json_default, sort_keys=sort_keys, indent=indent)