From dd7a972108d1632d28e08fd92a5aa8f728eb5943 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Mon, 23 Dec 2019 21:52:50 +0100
Subject: mod_http_files: Log something if unable to load MIME database

Not that much to worry about, the most common file types are included in
the code above.
---
 plugins/mod_http_files.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index c357ddfc..4d0b14cd 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -33,7 +33,9 @@ if not mime_map then
 	module:shared("/*/http_files/mime").types = mime_map;
 
 	local mime_types, err = open(module:get_option_path("mime_types_file", "/etc/mime.types", "config"), "r");
-	if mime_types then
+	if not mime_types then
+		module:log("debug", "Could not open MIME database: %s", err);
+	else
 		local mime_data = mime_types:read("*a");
 		mime_types:close();
 		setmetatable(mime_map, {
-- 
cgit v1.2.3