# HG changeset patch # User Matthew Wild # Date 1353606134 0 # Node ID e71cf524893cbdd83585d3e873ce92e8da136b19 # Parent 9b93b0698d7e3ccdefa68bb93513cd3a9182de5f# Parent 8461e8ed7c09f169b643c327beb207c596b624fb Merge 0.9->trunk diff -r 9b93b0698d7e -r e71cf524893c plugins/mod_http.lua --- a/plugins/mod_http.lua Thu Nov 15 14:07:53 2012 -0500 +++ b/plugins/mod_http.lua Thu Nov 22 17:42:14 2012 +0000 @@ -48,16 +48,16 @@ -- Helper to deduce a module's external URL function moduleapi.http_url(module, app_name, default_path) app_name = app_name or (module.name:gsub("^http_", "")); - local ext = url_parse(module:get_option_string("http_external_url")) or {}; + local external_url = url_parse(module:get_option_string("http_external_url")) or {}; 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 for port, services in pairs(ports) do local url = { - scheme = (ext.scheme or services[1].service.name); - host = (ext.host or module.host); - port = tonumber(ext.port) or port or 80; - path = normalize_path(ext.path or "/").. + scheme = (external_url.scheme or services[1].service.name); + host = (external_url.host or module.host); + port = tonumber(external_url.port) or port or 80; + path = normalize_path(external_url.path or "/").. (get_base_path(module, app_name, default_path or "/"..app_name):sub(2)); } if ports_by_scheme[url.scheme] == url.port then url.port = nil end