Skip to content

Commit

Permalink
Make get_extra_audit_log_values more defensive
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional committed Apr 3, 2024
1 parent 11c371c commit 74f1f3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def get_extra_audit_log_values(request: Request) -> dict | None:
if not headers:
return None

return json.loads(headers)
try:
return json.loads(headers)
except json.JSONDecodeError:
logging.error(f'Could not parse sm-extra-values: {headers}')
return None


def get_on_behalf_of(request: Request) -> str | None:
Expand Down

0 comments on commit 74f1f3e

Please sign in to comment.