diff --git a/handler.go b/handler.go index 326061a..6c101ec 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 { + // Only list world readable files + if uint64(file.Mode().Perm())&0444 != 0444 { + continue + } listing += fmt.Sprintf("=> %s %s\n", file.Name(), file.Name()) } return listing