Skip to content

Commit

Permalink
πŸ› Make sure file:// dir paths end in slash
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Dec 20, 2020
1 parent 8ec9bb7 commit 36455e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions display/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func handleFile(u string) (*structs.Page, bool) {

switch mode := fi.Mode(); {
case mode.IsDir():
// Must end in slash
if u[len(u)-1] != '/' {
u += "/"
}
return createDirectoryListing(u)
case mode.IsRegular():
if fi.Size() > viper.GetInt64("a-general.page_max_size") {
Expand Down

0 comments on commit 36455e8

Please sign in to comment.