Skip to content

Commit

Permalink
Fix sanitization for bulk queries
Browse files Browse the repository at this point in the history
  • Loading branch information
GilTeixeira committed Oct 6, 2023
1 parent 7ac6744 commit 5e576df
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ def _unflatten_dict(d):


def sanitize_body(body) -> str:
if isinstance(body, bytes):
body = body.decode("utf8")

if isinstance(body, str):
body = json.loads(body)

if isinstance(body, list):
return str([sanitize_body(elem) for elem in body])

flatten_body = _flatten_dict(body)

for key in flatten_body:
Expand Down

0 comments on commit 5e576df

Please sign in to comment.