aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-03-27 22:11:58 +0000
committerMatthew Wild <mwild1@gmail.com>2015-03-27 22:11:58 +0000
commiteaf02c2e7fef247e6ff9c4eeb9fb3dfb1c28e5c1 (patch)
tree05c689e53d3416f52f0e9c782cf05887e5fe14da /plugins/mod_http.lua
parent45e1b4d1da5e5c9825e23368d8de92c4c5c390de (diff)
parent382cb50f5196dd4a935a09f5515904820a3ea286 (diff)
downloadprosody-eaf02c2e7fef247e6ff9c4eeb9fb3dfb1c28e5c1.tar.gz
prosody-eaf02c2e7fef247e6ff9c4eeb9fb3dfb1c28e5c1.zip
Merge 0.9->0.10 (third time lucky)
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r--plugins/mod_http.lua8
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)