diff options
author | Kim Alvefur <zash@zash.se> | 2014-02-26 22:22:43 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-02-26 22:22:43 +0100 |
commit | b438e60d17b5103114ff9e187d171960d88259c9 (patch) | |
tree | 1c5e65e70f484393b24c0bcd9ecd9f6c30d55922 /plugins | |
parent | 383feaeddeb540024d5b06f97d402cef3061b7d5 (diff) | |
parent | 4996a4724e87130c36f8d90b6cdf3628d39cebd8 (diff) | |
download | prosody-b438e60d17b5103114ff9e187d171960d88259c9.tar.gz prosody-b438e60d17b5103114ff9e187d171960d88259c9.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_auth_anonymous.lua | 2 | ||||
-rw-r--r-- | plugins/mod_http.lua | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua index c877d532..8de46f8c 100644 --- a/plugins/mod_auth_anonymous.lua +++ b/plugins/mod_auth_anonymous.lua @@ -43,7 +43,7 @@ function provider.get_sasl_handler() end function provider.users() - return next, hosts[host].sessions, nil; + return next, hosts[module.host].sessions, nil; end -- datamanager callback to disable writes 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 |