Comparison

plugins/mod_http_files.lua @ 13213:50324f66ca2a

plugins: Use integer config API with interval specification where sensible Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff
author Kim Alvefur <zash@zash.se>
date Mon, 17 Jul 2023 01:38:54 +0200
parent 12977:74b9e05af71e
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
10 10
11 local open = io.open; 11 local open = io.open;
12 local fileserver = require"prosody.net.http.files"; 12 local fileserver = require"prosody.net.http.files";
13 13
14 local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path")); 14 local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path"));
15 local cache_size = module:get_option_number("http_files_cache_size", 128); 15 local cache_size = module:get_option_integer("http_files_cache_size", 128, 1);
16 local cache_max_file_size = module:get_option_number("http_files_cache_max_file_size", 4096); 16 local cache_max_file_size = module:get_option_integer("http_files_cache_max_file_size", 4096, 1);
17 local dir_indices = module:get_option_array("http_index_files", { "index.html", "index.htm" }); 17 local dir_indices = module:get_option_array("http_index_files", { "index.html", "index.htm" });
18 local directory_index = module:get_option_boolean("http_dir_listing"); 18 local directory_index = module:get_option_boolean("http_dir_listing");
19 19
20 local mime_map = module:shared("/*/http_files/mime").types; 20 local mime_map = module:shared("/*/http_files/mime").types;
21 if not mime_map then 21 if not mime_map then