From a67d1b113a14c300e611e0bd323ac975e3c6bcdd Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Fri, 22 Nov 2019 21:35:51 +0200 Subject: [PATCH] Don't list dot files. --- handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler.go b/handler.go index 6c101ec..ae0d6b6 100644 --- a/handler.go +++ b/handler.go @@ -156,6 +156,10 @@ func generateDirectoryListing(path string) string { } listing = "# Directory listing\n\n" for _, file := range files { + // Skip dotfiles + if strings.HasPrefix(file.Name(), ".") { + continue + } // Only list world readable files if uint64(file.Mode().Perm())&0444 != 0444 { continue