Speedy hack to make HTML files display, will need a more robust solution later

This commit is contained in:
Ana Custura 2026-04-03 16:44:27 +01:00
parent 009595354e
commit 2eafbbd82f

View file

@ -140,10 +140,9 @@ def files(path):
@app.route('/serve_file/<path:filepath>')
def serve_file(filepath):
full_path = os.path.realpath(filepath)
if not filepath.startswith(app.config["BUTTERBOX_USB_PATH"]):
redirect(url_for('files', path=""))
return send_file(full_path)
return send_file("/" + filepath)
@app.route('/login', methods=['GET', 'POST'])
def login():