From 18c056167f22c9f2f5944c5c8e797d6fffeba89e Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Mon, 29 Jun 2020 17:17:43 +0200 Subject: [PATCH] Make it possible to toggle handling of .molly files on and off via main config. --- config.go | 1 + handler.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index c44fe35..fad2ff1 100644 --- a/config.go +++ b/config.go @@ -16,6 +16,7 @@ type Config struct { DefaultLang string AccessLog string ErrorLog string + ReadMollyFiles bool TempRedirects map[string]string PermRedirects map[string]string MimeOverrides map[string]string diff --git a/handler.go b/handler.go index a71dc35..0a5d094 100644 --- a/handler.go +++ b/handler.go @@ -163,7 +163,9 @@ func handleGeminiRequest(conn net.Conn, config Config, accessLogEntries chan Log } // Read Molly files - parseMollyFiles(path, info, &config, errorLogEntries) + if config.ReadMollyFiles { + parseMollyFiles(path, info, &config, errorLogEntries) + } // Handle directories if info.IsDir() {