diff options
author | Kim Alvefur <zash@zash.se> | 2014-02-26 22:19:58 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-02-26 22:19:58 +0100 |
commit | 2581518210994e410d8163d6aeb32b010a8f1cde (patch) | |
tree | 1a0dfe38458edd6e7400a61a0e0ca562f43af1a5 /plugins/mod_http.lua | |
parent | 33973cf0ddebe3da6c0849ff4cc7104f8e8554f8 (diff) | |
download | prosody-2581518210994e410d8163d6aeb32b010a8f1cde.tar.gz prosody-2581518210994e410d8163d6aeb32b010a8f1cde.zip |
mod_http: Fix http_external_url setting without an explicit port
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r-- | plugins/mod_http.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index afcec069..86689aff 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -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 |