forked from mirrors/bookwyrm
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()
|
return HttpResponseNotFound()
|
||||||
|
|
||||||
try:
|
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']
|
activity_object = activity['object']
|
||||||
except (json.decoder.JSONDecodeError, KeyError):
|
except (json.decoder.JSONDecodeError, KeyError):
|
||||||
return HttpResponseBadRequest()
|
return HttpResponseBadRequest()
|
||||||
|
|
Loading…
Reference in a new issue