aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-02-04 19:58:43 +0100
committerKim Alvefur <zash@zash.se>2022-02-04 19:58:43 +0100
commit35e77293c0e2e0aecb8931bf4900cdccd20abcfe (patch)
tree948a296bc02f578e4b238b03077c3a4f5eb8c606 /plugins
parentcf575b27fe9b71cde258cd473f448eb49ede910f (diff)
downloadprosody-35e77293c0e2e0aecb8931bf4900cdccd20abcfe.tar.gz
prosody-35e77293c0e2e0aecb8931bf4900cdccd20abcfe.zip
mod_http: Use http_default_host for URLs generated in global context
This might make the global routes less confusing sometimes, or at least valid URLs instead of http://*:5280/ which doesn't make much sense.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index ef951450..9144ff49 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -94,7 +94,8 @@ function moduleapi.http_url(module, app_name, default_path)
for port, service in pairs(ports) do -- luacheck: ignore 512
local url = {
scheme = service[1].service.name;
- host = module:get_option_string("http_host", module.host);
+ host = module:get_option_string("http_host", module.global
+ and module:get_option_string("http_default_host") or module.host);
port = port;
path = get_base_path(module, app_name, default_path or "/" .. app_name);
}