Skip to content

Commit

Permalink
append trailing slash for directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Headary committed Oct 3, 2024
1 parent 455f555 commit a446fb1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def repository(repoName, path=''):
if not os.path.exists(targetPath):
abort(404)

if (path != '' and os.path.isdir(targetPath) and path[-1] != '/'):
return redirect(url_for('repository', repoName = repoName, path=path+'/'))

if os.path.isdir(targetPath):
directoryContent = next(os.walk(targetPath))
# filter directories and files starting with .
Expand Down

0 comments on commit a446fb1

Please sign in to comment.