Changeset

10548:c88f979946c4

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.
author Kim Alvefur <zash@zash.se>
date Mon, 23 Dec 2019 21:52:50 +0100
parents 10547:c77471c180ea
children 10549:3e50f86e5a2e
files plugins/mod_http_files.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_http_files.lua	Mon Dec 23 21:52:28 2019 +0100
+++ b/plugins/mod_http_files.lua	Mon Dec 23 21:52:50 2019 +0100
@@ -33,7 +33,9 @@
 	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, {