Comparison

plugins/mod_http_files.lua @ 13874:bfa8ac5881a0 default tip

mod_http_files: Fail if missing the required 'http_files_dir' setting
author Kim Alvefur <zash@zash.se>
date Tue, 13 May 2025 22:38:34 +0200
parent 13873:8525b7c7ba6c
comparison
equal deleted inserted replaced
13873:8525b7c7ba6c 13874:bfa8ac5881a0
9 module:depends("http"); 9 module:depends("http");
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 = assert(module:get_option_path("http_files_dir", module:get_option_path("http_path")), "missing required setting 'http_files_dir'");
15 local cache_size = module:get_option_integer("http_files_cache_size", 128, 1); 15 local cache_size = module:get_option_integer("http_files_cache_size", 128, 1);
16 local cache_max_file_size = module:get_option_integer("http_files_cache_max_file_size", 4096, 1); 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