# HG changeset patch # User Kim Alvefur # Date 1612391282 -3600 # Node ID dab1a6e46087758790efdce82734920d6a69179d # Parent f36a2e54ac815d86b2b180d8b5fa642ba86fc610 mod_admin_shell: List global HTTP endpoints by default Trick copied from the module commands diff -r f36a2e54ac81 -r dab1a6e46087 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Wed Feb 03 22:13:33 2021 +0100 +++ b/plugins/mod_admin_shell.lua Wed Feb 03 23:28:02 2021 +0100 @@ -1224,12 +1224,17 @@ function def_env.http:list(hosts) local print = self.session.print; + hosts = array.collect(set.new({ not hosts and "*" or nil }) + get_hosts_set(hosts)):sort(_sort_hosts); - for host in get_hosts_set(hosts) do + for _, host in ipairs(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"); - print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + if host == "*" then + print("Global HTTP endpoints available on all hosts:"); + else + print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + end for _, provider in ipairs(http_apps) do local url = module:context(host):http_url(provider.name, provider.default_path); print("", url);