forked from mirrors/bookwyrm
Received bytes, expecting a string
This doesn't seem like a *good* solution, but I'm not sure why sometimes this receives strings and sometimes bytes (maybe it's based on how the data is served).
This commit is contained in:
parent
d8800b09c4
commit
51e9977d55
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