aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-02-26 22:21:55 +0100
committerKim Alvefur <zash@zash.se>2014-02-26 22:21:55 +0100
commit4996a4724e87130c36f8d90b6cdf3628d39cebd8 (patch)
treeace5cad832311d8026958763adde400641650098 /plugins/mod_http.lua
parent09eda513a8d25ca83612ca87d99d7208f211b608 (diff)
parent9ff00bc6169d7d64d4cea491c1b225ff0e3efa8a (diff)
downloadprosody-4996a4724e87130c36f8d90b6cdf3628d39cebd8.tar.gz
prosody-4996a4724e87130c36f8d90b6cdf3628d39cebd8.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r--plugins/mod_http.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index 95933da5..d987ef74 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -42,7 +42,7 @@ local function get_base_path(host_module, app_name, default_app_path)
return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host
or module:get_option("http_paths", {})[app_name] -- Global
or default_app_path)) -- Default
- :gsub("%$(%w+)", { host = module.host });
+ :gsub("%$(%w+)", { host = host_module.host });
end
local ports_by_scheme = { http = 80, https = 443, };
@@ -51,6 +51,9 @@ local ports_by_scheme = { http = 80, https = 443, };
function moduleapi.http_url(module, app_name, default_path)
app_name = app_name or (module.name:gsub("^http_", ""));
local external_url = url_parse(module:get_option_string("http_external_url")) or {};
+ if external_url.scheme and external_url.port == nil then
+ external_url.port = ports_by_scheme[external_url.scheme];
+ end
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