From 51dda0db902bec61cd8b76ed10d5c4b03694d285 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 10 Oct 2022 10:20:08 +0200 Subject: [server] prevent incorrect caching of JSONs served by Hydrilla --- src/hydrilla/server/serve.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/hydrilla/server') diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index e6ba484..4e2eb00 100644 --- a/src/hydrilla/server/serve.py +++ b/src/hydrilla/server/serve.py @@ -141,7 +141,11 @@ def get_resource_or_mapping(item_type: str, identifier: str) \ # no need for send_from_directory(); path is safe, constructed by us info_path = f'{info.identifier}/{versions.version_string(info.version)}' file_path = get_malcontent().malcontent_dir_path / item_type / info_path - return flask.send_file(open(file_path, 'rb'), mimetype='application/json') + return flask.send_file( + str(file_path), + mimetype = 'application/json', + etag = False + ) @bp.route('/mapping/') def get_newest_mapping(identifier_dot_json: str) -> werkzeug.Response: -- cgit v1.2.3