diff --git a/gns3server/handlers/api/project_handler.py b/gns3server/handlers/api/project_handler.py index d2c80a12..0e00ffb8 100644 --- a/gns3server/handlers/api/project_handler.py +++ b/gns3server/handlers/api/project_handler.py @@ -272,19 +272,15 @@ class ProjectHandler: response.content_length = None try: - yield from wait_run_in_executor(ProjectHandler._read_file, path, request, response) + with open(path, "rb") as f: + response.start(request) + while True: + data = f.read(4096) + if not data: + break + yield from response.write(data) + except FileNotFoundError: raise aiohttp.web.HTTPNotFound() except PermissionError: raise aiohttp.web.HTTPForbidden - - @staticmethod - def _read_file(path, request, response): - - with open(path, "rb") as f: - response.start(request) - while True: - data = f.read(4096) - if not data: - break - response.write(data)