refactor: Handle edge case in main.py for current_file parameter

The main.py file has been refactored to handle an edge case where the current_file parameter is empty. This change ensures that the code correctly checks for the presence of the current_file parameter before performing further actions.
This commit is contained in:
Théophile Diot 2024-08-07 16:46:31 +01:00
parent d9b37ca7c3
commit efebf6b2a3
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -2142,7 +2142,7 @@ def logs():
current_file = secure_filename(request.args.get("file", ""))
if current_file not in files:
if current_file and current_file not in files:
return Response("No such file", 404)
if isabs(current_file) or ".." in current_file: