# HG changeset patch # User Kim Alvefur # Date 1577134370 -3600 # Node ID c88f979946c4e5b2ac7a5e92c3d0aad2a15a1982 # Parent c77471c180eaece5e1a734403ef76b3e363b4b28 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. diff -r c77471c180ea -r c88f979946c4 plugins/mod_http_files.lua --- 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, {