aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_files.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-23 21:52:50 +0100
committerKim Alvefur <zash@zash.se>2019-12-23 21:52:50 +0100
commiteb54e65e689ba596a562f34fa5ee3e24a1eb5ec9 (patch)
tree43131cadd21ad5a723c26ec67d33def380490e48 /plugins/mod_http_files.lua
parent4da419b6282e9e57aebabf5db0e3f62731657530 (diff)
downloadprosody-eb54e65e689ba596a562f34fa5ee3e24a1eb5ec9.tar.gz
prosody-eb54e65e689ba596a562f34fa5ee3e24a1eb5ec9.zip
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.
Diffstat (limited to 'plugins/mod_http_files.lua')
-rw-r--r--plugins/mod_http_files.lua4
1 files changed, 3 insertions, 1 deletions
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, {