Fix lazyLoading script

This commit is contained in:
Michał Gdula 2023-04-04 14:21:16 +00:00
parent a83930e377
commit bf8142623e
5 changed files with 6 additions and 8 deletions

View file

@ -38,7 +38,7 @@ def file(file_name):
file_name = secure_filename(file_name) # Sanitize file name
# if no args are passed, return the raw file
if not request.args:
if not res and not ext:
if not os.path.exists(os.path.join(current_app.config['UPLOAD_FOLDER'], file_name)):
abort(404)
return send_from_directory(current_app.config['UPLOAD_FOLDER'], file_name)