This commit is contained in:
Aaron Kimbre 2022-05-11 21:33:31 -05:00
parent 35ee0ed457
commit a07515cdb2

View File

@ -147,10 +147,11 @@ def brick_list():
return response
@luclient_blueprint.route('/ldddb/<path>')
def dir_listing(path):
@luclient_blueprint.route('/ldddb/', defaults={'req_path': ''})
@luclient_blueprint.route('/ldddb/<path:req_path>')
def dir_listing(req_path):
# Joining the base and the requested path
rel_path = pathlib.Path(str(pathlib.Path(f'app/luclient/res/{path}').resolve()))
rel_path = pathlib.Path(str(pathlib.Path(f'app/luclient/res/{req_path}').resolve()))
# Return 404 if path doesn't exist
if not rel_path.exists():
return abort(404)