From 36455e800b9c0f5cdbdde3b01b3854f5a406fa70 Mon Sep 17 00:00:00 2001 From: makeworld Date: Sun, 20 Dec 2020 16:58:29 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Make=20sure=20file://=20dir=20pa?= =?UTF-8?q?ths=20end=20in=20slash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- display/file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/display/file.go b/display/file.go index 51a660c..9349c86 100644 --- a/display/file.go +++ b/display/file.go @@ -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") {