diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-12-10 18:58:30 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-12-10 18:58:30 +0000 |
commit | 499d239662bfc5d663335626664adb0500efa5bc (patch) | |
tree | 6abe7e628961f73a7f0a5b15d5715ded3345a77a /plugins | |
parent | 60a27e378108dfaf2cfec678eaed357f79ced051 (diff) | |
parent | 47fd3f55f22d92f1fa2d25097545a6b4a17d3564 (diff) | |
download | prosody-499d239662bfc5d663335626664adb0500efa5bc.tar.gz prosody-499d239662bfc5d663335626664adb0500efa5bc.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 29 | ||||
-rw-r--r-- | plugins/mod_compression.lua | 2 |
2 files changed, 29 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 7aea28ba..aa7b10cb 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -282,6 +282,8 @@ end -- Session environment -- -- Anything in def_env will be accessible within the session as a global variable +--luacheck: ignore 212/self + def_env.server = {}; function def_env.server:insane_reload() @@ -1125,6 +1127,33 @@ function def_env.dns:cache() return true, "Cache:\n"..tostring(dns.cache()) end +def_env.http = {}; + +function def_env.http:list() + local print = self.session.print; + + for host in pairs(prosody.hosts) do + local http_apps = modulemanager.get_items("http-provider", host); + if #http_apps > 0 then + local http_host = module:context(host):get_option("http_host"); + print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + for _, provider in ipairs(http_apps) do + local url = module:context(host):http_url(provider.name); + print("", url); + end + print(""); + end + end + + local default_host = module:get_option("http_default_host"); + if not default_host then + print("HTTP requests to unknown hosts will return 404 Not Found"); + else + print("HTTP requests to unknown hosts will be handled by "..default_host); + end + return true; +end + ------------- function printbanner(session) diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index da55e5bb..d49e3880 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -27,14 +27,12 @@ end module:hook("stream-features", function(event) local origin, features = event.origin, event.features; if not origin.compressed and origin.type == "c2s" then - -- FIXME only advertise compression support when TLS layer has no compression enabled features:add_child(compression_stream_feature); end end); module:hook("s2s-stream-features", function(event) local origin, features = event.origin, event.features; - -- FIXME only advertise compression support when TLS layer has no compression enabled if not origin.compressed and origin.type == "s2sin" then features:add_child(compression_stream_feature); end |