Software /
code /
prosody
Comparison
plugins/mod_http_files.lua @ 7978:01aa6344a556
mod_http_files: Use API for config options that are file paths
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Mar 2017 20:53:08 +0100 |
parent | 7977:01d6298de991 |
child | 7985:6521a51bb718 |
comparison
equal
deleted
inserted
replaced
7977:01d6298de991 | 7978:01aa6344a556 |
---|---|
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_string("mime_types_file", "/etc/mime.types"),"r"); | 40 local mime_types, err = open(module:get_option_path("mime_types_file", "/etc/mime.types", prosody.paths.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) |