Skip to content

Commit

Permalink
fix: base64 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Sep 25, 2024
1 parent 563ecde commit 6a05326
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/prelude.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from enum import Enum
from abc import ABC, abstractmethod
from datetime import datetime
from base64 import b64encode, b64decode

import extism_ffi as ffi

Expand Down Expand Up @@ -59,16 +60,15 @@ def object_hook(self, dct):
try:
dct[k] = datetime.fromisoformat(v)
continue
except:
except Exception as _:
pass

try:
dct[k] = b64decode(v)
dct[k] = b64decode(v.encode())
continue
except:
except Exception as _:
pass

if isinstance(v, dict):
elif isinstance(v, dict):
dct[k] = self.object_hook(v)
return dct

Expand Down

0 comments on commit 6a05326

Please sign in to comment.