From 980003d6fc3501045c2b252e2188aa51dfb2d982 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 22 Feb 2022 16:50:42 +0100 Subject: use flask.send_file() in a way comptible with WSGI deployment --- src/hydrilla/server/serve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index 4ec2a17..32df0eb 100644 --- a/src/hydrilla/server/serve.py +++ b/src/hydrilla/server/serve.py @@ -533,7 +533,7 @@ def get_resource_or_mapping(item_type: str, identifier: str) -> Response: # no need for send_from_directory(); path is safe, constructed by us file_path = malcontent().malcontent_dir_path / item_type / info.path() - return flask.send_file(file_path) + return flask.send_file(open(file_path, 'rt'), mimetype='application/json') @bp.route('/mapping/') def get_newest_mapping(identifier_dot_json: str) -> Response: -- cgit v1.2.3