mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-11 21:18:35 +03:00
8 lines
212 B
Python
8 lines
212 B
Python
import base64
|
|
from fastapi.encoders import jsonable_encoder
|
|
|
|
def custom_jsonable_encoder(obj):
|
|
if isinstance(obj, bytes):
|
|
return base64.b64encode(obj).decode('utf-8')
|
|
return jsonable_encoder(obj)
|