aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-04-03 12:56:11 +0100
committerMatthew Wild <mwild1@gmail.com>2022-04-03 12:56:11 +0100
commit0f493bd245b85da4272d360c85d193321d7e2e3f (patch)
tree40b3fc2e214537db7af6851766160cb8d9ea8f7a /core
parent1e2d4026f9c914fb5f27f4ecc1d8dc90a4669d8e (diff)
downloadprosody-0f493bd245b85da4272d360c85d193321d7e2e3f.tar.gz
prosody-0f493bd245b85da4272d360c85d193321d7e2e3f.zip
configmanager: Clearer errors when providing unexpected values after VirtualHost (fixes #1735, thanks arawaks)
Diffstat (limited to 'core')
-rw-r--r--core/configmanager.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua
index 4cd7c9d6..092b3946 100644
--- a/core/configmanager.lua
+++ b/core/configmanager.lua
@@ -160,6 +160,11 @@ do
set(config_table, name or "*", "defined", true);
return function (config_options)
rawset(env, "__currenthost", "*"); -- Return to global scope
+ if type(config_options) == "string" then
+ error(format("VirtualHost entries do not accept a module name (module '%s' provided for host '%s')", config_options, name), 2);
+ elseif type(config_options) ~= "table" then
+ error("Invalid syntax following VirtualHost, expected options but received a "..type(config_options), 2);
+ end
for option_name, option_value in pairs(config_options) do
set(config_table, name or "*", option_name, option_value);
end