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

Fix async version of decode_request

so thath it does not fail if no payload at all is provided in the request,
eg. for an endpoint which really is (or at least should be) a simple GET...
parent 508e3d0d
No related branches found
No related tags found
1 merge request!372 small improvements
......@@ -22,7 +22,8 @@ def encode_data_server(data, **kwargs):
def decode_request(request):
content_type = request.headers.get('Content-Type')
data = yield from request.read()
if not data:
return {}
if content_type == 'application/x-msgpack':
r = msgpack_loads(data)
elif content_type == 'application/json':
......
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