diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-03-07 13:40:45 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-03-07 13:40:45 +0100 |
commit | 6a7f4f337729688c45e23bb8305c4ac46ccb0586 (patch) | |
tree | 4c5ef52edad88bc277c66d9d481cf55cad66a55d /src/hydrilla/server | |
parent | aee1aed7a37e2297b55d3495cfaeff81610c0137 (diff) | |
download | haketilo-hydrilla-6a7f4f337729688c45e23bb8305c4ac46ccb0586.tar.gz haketilo-hydrilla-6a7f4f337729688c45e23bb8305c4ac46ccb0586.zip |
fix sending of JSON definition straight from disk file
Diffstat (limited to 'src/hydrilla/server')
-rw-r--r-- | src/hydrilla/server/serve.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index d0b1ab6..683b95b 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(open(file_path, 'rt'), mimetype='application/json') + return flask.send_file(open(file_path, 'rb'), mimetype='application/json') @bp.route('/mapping/<string:identifier_dot_json>') def get_newest_mapping(identifier_dot_json: str) -> Response: |