Diff

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
line wrap: on
line diff
--- a/plugins/mod_http_files.lua	Tue May 13 22:38:30 2025 +0200
+++ b/plugins/mod_http_files.lua	Tue May 13 22:38:34 2025 +0200
@@ -11,7 +11,7 @@
 local open = io.open;
 local fileserver = require"prosody.net.http.files";
 
-local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path"));
+local base_path = assert(module:get_option_path("http_files_dir", module:get_option_path("http_path")), "missing required setting 'http_files_dir'");
 local cache_size = module:get_option_integer("http_files_cache_size", 128, 1);
 local cache_max_file_size = module:get_option_integer("http_files_cache_max_file_size", 4096, 1);
 local dir_indices = module:get_option_array("http_index_files", { "index.html", "index.htm" });