mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
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:
|
try:
|
||||||
resp = request.body
|
resp = request.body
|
||||||
if isinstance(resp, bytes):
|
|
||||||
resp = json.loads(resp)
|
|
||||||
activity = json.loads(resp)
|
activity = json.loads(resp)
|
||||||
|
if isinstance(resp, str):
|
||||||
|
resp = json.loads(resp)
|
||||||
activity_object = activity['object']
|
activity_object = activity['object']
|
||||||
except (json.decoder.JSONDecodeError, KeyError):
|
except (json.decoder.JSONDecodeError, KeyError):
|
||||||
return HttpResponseBadRequest()
|
return HttpResponseBadRequest()
|
||||||
|
|
Loading…
Reference in a new issue