summaryrefslogtreecommitdiff
path: root/src/hydrilla
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-22 16:50:42 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-22 16:56:29 +0100
commit980003d6fc3501045c2b252e2188aa51dfb2d982 (patch)
treef6a8ab16569534a9928acc6c06119236a47f6575 /src/hydrilla
parent48a0cd8ee5581c64f41988798b5aa7c73e25b1aa (diff)
downloadhaketilo-hydrilla-980003d6fc3501045c2b252e2188aa51dfb2d982.tar.gz
haketilo-hydrilla-980003d6fc3501045c2b252e2188aa51dfb2d982.zip
use flask.send_file() in a way comptible with WSGI deployment
Diffstat (limited to 'src/hydrilla')
-rw-r--r--src/hydrilla/server/serve.py2
1 files changed, 1 insertions, 1 deletions
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/<string:identifier_dot_json>')
def get_newest_mapping(identifier_dot_json: str) -> Response: