Skip to content

Commit

Permalink
get_result() revert; use send_from_directory to ensure only files i…
Browse files Browse the repository at this point in the history
…n data dir can be served.
  • Loading branch information
dale-wahl committed Sep 28, 2023
1 parent 33d8ec1 commit 8684719
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webtool/views/views_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def show_results(page):
"""


@app.route('/result/<string:query_file>')
@app.route('/result/<path:query_file>')
def get_result(query_file):
"""
Get dataset result file
Expand All @@ -167,8 +167,7 @@ def get_result(query_file):
:return: Result file
:rmime: text/csv
"""
path = config.get('PATH_ROOT').joinpath(config.get('PATH_DATA')).joinpath(query_file)
return send_from_directory(directory=path.parent, path=path.name)
return send_from_directory(directory=config.get('PATH_ROOT').joinpath(config.get('PATH_DATA')), path=query_file)


@app.route('/mapped-result/<string:key>/')
Expand Down

0 comments on commit 8684719

Please sign in to comment.