diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-02 13:55:38 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-02 13:55:38 +0100 |
commit | 20226a9804f6ce4e44f1413df1ac54e1f0ebc34c (patch) | |
tree | 4b8dea6ba311e0a0b6dcaf224fd005955c804f6c /core/configmanager.lua | |
parent | 534f64b5c8c2fa62405055ef0098d54dce0de275 (diff) | |
download | prosody-20226a9804f6ce4e44f1413df1ac54e1f0ebc34c.tar.gz prosody-20226a9804f6ce4e44f1413df1ac54e1f0ebc34c.zip |
core.configmanager: Ensure Hosts are given names
Prevents traceback from nameprep(nil)
Diffstat (limited to 'core/configmanager.lua')
-rw-r--r-- | core/configmanager.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua index 090a6a0a..8ed74e3c 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -138,6 +138,9 @@ do rawset(env, "__currenthost", "*") -- Default is global function env.VirtualHost(name) + if not name then + error("Host must have a name", 2); + end name = nameprep(name); if rawget(config_table, name) and rawget(config_table[name], "component_module") then error(format("Host %q clashes with previously defined %s Component %q, for services use a sub-domain like conference.%s", @@ -156,6 +159,9 @@ do env.Host, env.host = env.VirtualHost, env.VirtualHost; function env.Component(name) + if not name then + error("Component must have a name", 2); + end name = nameprep(name); if rawget(config_table, name) and rawget(config_table[name], "defined") and not rawget(config_table[name], "component_module") then |