Speedy hack to make HTML files display, will need a more robust solution later
This commit is contained in:
parent
009595354e
commit
2eafbbd82f
1 changed files with 1 additions and 2 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue