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
commitdd7a972108d1632d28e08fd92a5aa8f728eb5943 (patch)
tree43131cadd21ad5a723c26ec67d33def380490e48 /plugins/mod_http_files.lua
parent61273591cdd37e19284a070389ceb7bf040a5a1f (diff)
downloadprosody-dd7a972108d1632d28e08fd92a5aa8f728eb5943.tar.gz
prosody-dd7a972108d1632d28e08fd92a5aa8f728eb5943.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, {