Skip to content

Commit

Permalink
More changing to defaultJSONProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Filienko committed Aug 14, 2024
1 parent 61d8a2f commit 04ba266
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jwt_proxy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
# Workaround no JSON representation for datetime.timedelta
class CustomJSONProvider(DefaultJSONProvider):
def default(self, obj):
return str(obj)
if isinstance(obj, (bytes, bytearray)):
return obj.decode('utf-8')
try:
return super().default(obj)
except TypeError:
return str(obj)


def proxy_request(req, upstream_url, user_info=None):
Expand Down

0 comments on commit 04ba266

Please sign in to comment.