Mercurial > prosody-hg
comparison plugins/mod_http_files.lua @ 5688:345761f0c2be
mod_http_files: Put the MIME type map in a global shared table
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 13 Jun 2013 23:31:11 +0200 |
| parents | 7bc52402966d |
| children | 16db80c2b74d |
comparison
equal
deleted
inserted
replaced
| 5687:e879b53e9df8 | 5688:345761f0c2be |
|---|---|
| 17 | 17 |
| 18 local base_path = module:get_option_string("http_files_dir", module:get_option_string("http_path")); | 18 local base_path = module:get_option_string("http_files_dir", module:get_option_string("http_path")); |
| 19 local dir_indices = module:get_option("http_index_files", { "index.html", "index.htm" }); | 19 local dir_indices = module:get_option("http_index_files", { "index.html", "index.htm" }); |
| 20 local directory_index = module:get_option_boolean("http_dir_listing"); | 20 local directory_index = module:get_option_boolean("http_dir_listing"); |
| 21 | 21 |
| 22 local mime_map = module:shared("mime").types; | 22 local mime_map = module:shared("/*/http_files/mime").types; |
| 23 if not mime_map then | 23 if not mime_map then |
| 24 mime_map = { | 24 mime_map = { |
| 25 html = "text/html", htm = "text/html", | 25 html = "text/html", htm = "text/html", |
| 26 xml = "application/xml", | 26 xml = "application/xml", |
| 27 txt = "text/plain", | 27 txt = "text/plain", |
