mirror of
https://github.com/GNS3/gns3-server
synced 2025-02-26 07:02:12 +00:00
Fix creation of qemu img
Fix https://github.com/GNS3/gns3-gui/issues/1826
This commit is contained in:
parent
bfbc6ff0be
commit
27a1089806
@ -41,16 +41,15 @@ from ..config import Config
|
|||||||
def parse_request(request, input_schema, raw):
|
def parse_request(request, input_schema, raw):
|
||||||
"""Parse body of request and raise HTTP errors in case of problems"""
|
"""Parse body of request and raise HTTP errors in case of problems"""
|
||||||
|
|
||||||
content_length = request.content_length
|
request.json = {}
|
||||||
if content_length is not None and content_length > 0 and not raw:
|
if not raw:
|
||||||
body = yield from request.read()
|
body = yield from request.read()
|
||||||
|
if body:
|
||||||
try:
|
try:
|
||||||
request.json = json.loads(body.decode('utf-8'))
|
request.json = json.loads(body.decode('utf-8'))
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
request.json = {"malformed_json": body.decode('utf-8')}
|
request.json = {"malformed_json": body.decode('utf-8')}
|
||||||
raise aiohttp.web.HTTPBadRequest(text="Invalid JSON {}".format(e))
|
raise aiohttp.web.HTTPBadRequest(text="Invalid JSON {}".format(e))
|
||||||
else:
|
|
||||||
request.json = {}
|
|
||||||
|
|
||||||
# Parse the query string
|
# Parse the query string
|
||||||
if len(request.query_string) > 0:
|
if len(request.query_string) > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user