# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1747168714 -7200
# Node ID bfa8ac5881a01f84f03959a22585ffde777c47f4
# Parent  8525b7c7ba6c3fc5d6ddf6522008ac372b38606e
mod_http_files: Fail if missing the required 'http_files_dir' setting

diff -r 8525b7c7ba6c -r bfa8ac5881a0 plugins/mod_http_files.lua
--- 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" });