Skip to content

Commit

Permalink
Serialize JSON with b64 encoding/decoding for data field of LatestMit…
Browse files Browse the repository at this point in the history
…mDataEntry.py
  • Loading branch information
Grennith committed Jan 21, 2024
1 parent 547f811 commit 7adf606
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ async def from_json(json_data: Union[bytes, str]) -> Optional[LatestMitmDataEntr

async def to_json(self) -> bytes:
if isinstance(self.data, bytes):
self.data = str(base64.b64encode(self.data))
self.data = str(base64.b64encode(self.data), "utf-8")
return orjson.dumps(self.__dict__)

0 comments on commit 7adf606

Please sign in to comment.