mod_admin_telnet: Allow passing list of hosts to http:list()
authorKim Alvefur <zash@zash.se>
Mon, 24 Feb 2020 18:38:09 +0100
changeset 10667 fd651ba2317f
parent 10666 46373b97e648
child 10668 c2b79b44ded7
mod_admin_telnet: Allow passing list of hosts to http:list() Lets you select what hosts to list http services on. In particular, this enables listing global http services, which was not possible before.
plugins/mod_admin_telnet.lua
--- a/plugins/mod_admin_telnet.lua	Mon Feb 24 14:16:45 2020 +0100
+++ b/plugins/mod_admin_telnet.lua	Mon Feb 24 18:38:09 2020 +0100
@@ -1241,10 +1241,10 @@
 
 def_env.http = {};
 
-function def_env.http:list()
+function def_env.http:list(hosts)
 	local print = self.session.print;
 
-	for host in pairs(prosody.hosts) do
+	for host in get_hosts_set(hosts) do
 		local http_apps = modulemanager.get_items("http-provider", host);
 		if #http_apps > 0 then
 			local http_host = module:context(host):get_option_string("http_host");