fix body not json serializable

This commit is contained in:
Robert Resch 2021-05-19 22:44:33 +02:00
parent 607201faad
commit c5dfad41fa
No known key found for this signature in database
GPG key ID: 6B360759EB2ACAEE

View file

@ -237,7 +237,7 @@ class ConfServer:
else: else:
postbody = await request.post() postbody = await request.post()
to_log["request"]["body"] = postbody to_log["request"]["body"] = f"{postbody}"
response = await handler(request) response = await handler(request)
if response is None: if response is None:
@ -249,7 +249,7 @@ class ConfServer:
"status": f"{response.status}", "status": f"{response.status}",
} }
if not "application/octet-stream" in response.content_type: if not "application/octet-stream" in response.content_type:
to_log["response"]["status"] = f"{response.status}" to_log["response"]["body"] = f"{json.loads(response.body)}"
confserverlog.debug(json.dumps(to_log)) confserverlog.debug(json.dumps(to_log))