aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-11-22 17:42:14 +0000
committerMatthew Wild <mwild1@gmail.com>2012-11-22 17:42:14 +0000
commit9cc0fd7ad4d6d1e775726bcb91b007e9c27ff045 (patch)
tree12338f33582f40e0bfacb53b05b76b48b7613669 /plugins/mod_http.lua
parent1862c03a88a5fee03460dae23eb958eaa4d31580 (diff)
parent7f962c6d08b4a069b15e1d821b998bcf1339deef (diff)
downloadprosody-9cc0fd7ad4d6d1e775726bcb91b007e9c27ff045.tar.gz
prosody-9cc0fd7ad4d6d1e775726bcb91b007e9c27ff045.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r--plugins/mod_http.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index a7b4a45f..4f09716c 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -48,16 +48,16 @@ local ports_by_scheme = { http = 80, https = 443, };
-- Helper to deduce a module's external URL
function moduleapi.http_url(module, app_name, default_path)
app_name = app_name or (module.name:gsub("^http_", ""));
- local ext = url_parse(module:get_option_string("http_external_url")) or {};
+ local external_url = url_parse(module:get_option_string("http_external_url")) or {};
local services = portmanager.get_active_services();
local http_services = services:get("https") or services:get("http") or {};
for interface, ports in pairs(http_services) do
for port, services in pairs(ports) do
local url = {
- scheme = (ext.scheme or services[1].service.name);
- host = (ext.host or module.host);
- port = tonumber(ext.port) or port or 80;
- path = normalize_path(ext.path or "/")..
+ scheme = (external_url.scheme or services[1].service.name);
+ host = (external_url.host or module.host);
+ port = tonumber(external_url.port) or port or 80;
+ path = normalize_path(external_url.path or "/")..
(get_base_path(module, app_name, default_path or "/"..app_name):sub(2));
}
if ports_by_scheme[url.scheme] == url.port then url.port = nil end