Software /
code /
prosody
Diff
plugins/mod_http_files.lua @ 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 |
parent | 9951:f1594893998f |
child | 10778:a62b981db0e2 |
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, {