plugins/mod_http.lua
changeset 5332 5b73ac268a9e
parent 5230 6f5640375358
child 5374 b62c6cbcb065
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