[perf] add some exception message

This commit is contained in:
SouthFox 2023-04-06 17:36:49 +08:00
parent 964159a133
commit 789cd3f44c

View file

@ -82,10 +82,18 @@ async def inbox(
payload = await request.json()
if httpsig_checker:
await save_incoming(db_session, payload)
return Response(status_code=202)
if await save_incoming(db_session, payload):
return Response(status_code=202)
else:
return Response(
status_code=406,
content="invalid activitypub object"
)
else:
return Response(status_code=406)
return Response(
status_code=406,
content="invalid http-sig"
)
@app.post("/outbox")