feat(chalice): fixed trace payload parsing (#1244)

This commit is contained in:
Kraiem Taha Yassine 2023-05-11 13:13:25 +02:00 committed by GitHub
parent 15e5fe72f3
commit 7683c27abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,9 +113,10 @@ async def process_trace(action: str, path_format: str, request: Request, respons
body = await request.json()
except Exception:
pass
intersect = list(set(body.keys()) & set(IGNORE_IN_PAYLOAD))
for attribute in intersect:
body[attribute] = "HIDDEN"
if body:
intersect = list(set(body.keys()) & set(IGNORE_IN_PAYLOAD))
for attribute in intersect:
body[attribute] = "HIDDEN"
current_trace = TraceSchema(tenant_id=current_context.tenant_id,
user_id=current_context.user_id if isinstance(current_context, CurrentContext) \
else None,