forked from mirrors/bookwyrm
better bytes checking
but this still seems like the wrong thing
This commit is contained in:
parent
a6d436d05d
commit
fe03e95049
1 changed files with 2 additions and 2 deletions
|
@ -38,9 +38,9 @@ def shared_inbox(request):
|
|||
|
||||
try:
|
||||
resp = request.body
|
||||
if isinstance(resp, bytes):
|
||||
resp = json.loads(resp)
|
||||
activity = json.loads(resp)
|
||||
if isinstance(resp, str):
|
||||
resp = json.loads(resp)
|
||||
activity_object = activity['object']
|
||||
except (json.decoder.JSONDecodeError, KeyError):
|
||||
return HttpResponseBadRequest()
|
||||
|
|
Loading…
Reference in a new issue