Comparison

plugins/mod_http_files.lua @ 7985:6521a51bb718

mod_http_files: Pass only the name of the path, get_option_path knows how to deal with it
author Kim Alvefur <zash@zash.se>
date Fri, 17 Mar 2017 23:02:35 +0100
parent 7978:01aa6344a556
child 7991:35a02ba83af2
comparison
equal deleted inserted replaced
7983:879be73c0a58 7985:6521a51bb718
35 jpeg = "image/jpeg", jpg = "image/jpeg", 35 jpeg = "image/jpeg", jpg = "image/jpeg",
36 svg = "image/svg+xml", 36 svg = "image/svg+xml",
37 }; 37 };
38 module:shared("/*/http_files/mime").types = mime_map; 38 module:shared("/*/http_files/mime").types = mime_map;
39 39
40 local mime_types, err = open(module:get_option_path("mime_types_file", "/etc/mime.types", prosody.paths.config), "r"); 40 local mime_types, err = open(module:get_option_path("mime_types_file", "/etc/mime.types", "config"), "r");
41 if mime_types then 41 if mime_types then
42 local mime_data = mime_types:read("*a"); 42 local mime_data = mime_types:read("*a");
43 mime_types:close(); 43 mime_types:close();
44 setmetatable(mime_map, { 44 setmetatable(mime_map, {
45 __index = function(t, ext) 45 __index = function(t, ext)