Skip to content

Commit

Permalink
refactor: Handle edge case in main.py for current_file parameter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheophileDiot committed Aug 7, 2024
1 parent d9b37ca commit efebf6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit efebf6b

Please sign in to comment.