Software /
code /
prosody
Comparison
plugins/mod_http.lua @ 5332:5b73ac268a9e
mod_http: Expand $host in http_paths
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 18 Feb 2013 13:12:14 +0100 |
parent | 5230:6f5640375358 |
child | 5374:b62c6cbcb065 |
comparison
equal
deleted
inserted
replaced
5331:ffa740b4f08d | 5332:5b73ac268a9e |
---|---|
36 end | 36 end |
37 return method:upper().." "..host..app_path..path; | 37 return method:upper().." "..host..app_path..path; |
38 end | 38 end |
39 | 39 |
40 local function get_base_path(host_module, app_name, default_app_path) | 40 local function get_base_path(host_module, app_name, default_app_path) |
41 return normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host | 41 return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host |
42 or module:get_option("http_paths", {})[app_name] -- Global | 42 or module:get_option("http_paths", {})[app_name] -- Global |
43 or default_app_path); -- Default | 43 or default_app_path)) -- Default |
44 :gsub("%$(%w+)", { host = module.host }); | |
44 end | 45 end |
45 | 46 |
46 local ports_by_scheme = { http = 80, https = 443, }; | 47 local ports_by_scheme = { http = 80, https = 443, }; |
47 | 48 |
48 -- Helper to deduce a module's external URL | 49 -- Helper to deduce a module's external URL |