mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Merge pull request #230 from mouse-reeve/bytes
Received bytes, expecting a string
This commit is contained in:
commit
1705a550d4
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,10 @@ def shared_inbox(request):
|
|||
return HttpResponseNotFound()
|
||||
|
||||
try:
|
||||
activity = json.loads(request.body)
|
||||
resp = request.body
|
||||
if isinstance(resp, bytes):
|
||||
resp = json.loads(resp)
|
||||
activity = json.loads(resp)
|
||||
activity_object = activity['object']
|
||||
except (json.decoder.JSONDecodeError, KeyError):
|
||||
return HttpResponseBadRequest()
|
||||
|
|
Loading…
Reference in a new issue