diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-03-26 16:48:39 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-03-26 16:48:39 +0000 |
commit | 5cc3f03d5aab0516358addd949281c2e3fa70688 (patch) | |
tree | 96ae640eaeaadbeebeab641873a8a65ea1e8d743 /plugins/mod_http.lua | |
parent | 13edf3e093fd656d5110b277eca4c9805f3d925c (diff) | |
parent | 51bef3673c57c5a2e323a7eb1424c85498905f53 (diff) | |
download | prosody-5cc3f03d5aab0516358addd949281c2e3fa70688.tar.gz prosody-5cc3f03d5aab0516358addd949281c2e3fa70688.zip |
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r-- | plugins/mod_http.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index 8bda1cac..086887fb 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -74,6 +74,8 @@ function moduleapi.http_url(module, app_name, default_path) return url_build(url); end end + module:log("warn", "No http ports enabled, can't generate an external URL"); + return "http://disabled.invalid/"; end function module.add_host(module) @@ -118,6 +120,12 @@ function module.add_host(module) module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key); end end + local services = portmanager.get_active_services(); + if services:get("https") or services:get("http") then + module:log("debug", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path)); + else + module:log("warn", "Not listening on any ports, '%s' will be unreachable", app_name); + end end local function http_app_removed(event) |