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 | 4b69a96d83465e0b04b4b07043f28516da0afc92 (patch) | |
tree | 4b8dea6ba311e0a0b6dcaf224fd005955c804f6c /core | |
parent | fb0fee842496d9cf89464479406352161f2888bd (diff) | |
download | prosody-4b69a96d83465e0b04b4b07043f28516da0afc92.tar.gz prosody-4b69a96d83465e0b04b4b07043f28516da0afc92.zip |
core.configmanager: Ensure Hosts are given names
Prevents traceback from nameprep(nil)
Diffstat (limited to 'core')
-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 |