Skip to content
Snippets Groups Projects
Commit b5a48c4f authored by David Douard's avatar David Douard
Browse files

api: fix json decoder

json.loads() expect a str, not a bytes.
parent 60a114df
No related branches found
Tags swh-objstorage-20250326.1
1 merge request!64api/async: fix json decoder and add a few tests for the asynchronous api code
......@@ -27,7 +27,7 @@ async def decode_request(request):
if content_type == 'application/x-msgpack':
r = msgpack_loads(data)
elif content_type == 'application/json':
r = json.loads(data, cls=SWHJSONDecoder)
r = json.loads(data.decode(), cls=SWHJSONDecoder)
else:
raise ValueError('Wrong content type `%s` for API request'
% content_type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment