Skip to content

Commit db1c378

Browse files
Yonghuirtomayko
authored andcommitted
Use / suffix in text and URLs in directory listing
Signed-off-by: Ryan Tomayko <[email protected]>
1 parent a2b8481 commit db1c378

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rack/directory.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def list_directory
8989
type = stat.directory? ? 'directory' : Mime.mime_type(ext)
9090
size = stat.directory? ? '-' : filesize_format(size)
9191
mtime = stat.mtime.httpdate
92+
url << '/' if stat.directory?
93+
basename << '/' if stat.directory?
9294

9395
@files << [ url, basename, size, type, mtime ]
9496
end

0 commit comments

Comments
 (0)