Software /
code /
prosody
Comparison
plugins/mod_http.lua @ 6025:583e5c1365fe
mod_http: Use hostname from the correct context (thanks gryffus)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Feb 2014 19:08:55 +0100 |
parent | 5427:199e7989f713 |
child | 6026:8a8be471ec72 |
comparison
equal
deleted
inserted
replaced
6024:c352d97cf137 | 6025:583e5c1365fe |
---|---|
40 | 40 |
41 local function get_base_path(host_module, app_name, default_app_path) | 41 local function get_base_path(host_module, app_name, default_app_path) |
42 return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host | 42 return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host |
43 or module:get_option("http_paths", {})[app_name] -- Global | 43 or module:get_option("http_paths", {})[app_name] -- Global |
44 or default_app_path)) -- Default | 44 or default_app_path)) -- Default |
45 :gsub("%$(%w+)", { host = module.host }); | 45 :gsub("%$(%w+)", { host = host_module.host }); |
46 end | 46 end |
47 | 47 |
48 local ports_by_scheme = { http = 80, https = 443, }; | 48 local ports_by_scheme = { http = 80, https = 443, }; |
49 | 49 |
50 -- Helper to deduce a module's external URL | 50 -- Helper to deduce a module's external URL |