Comparison

core/modulemanager.lua @ 12450:7efd4bcaa95c 0.12

core.modulemanager: Fix global flag on per-host instances of shared modules (fix #1736) This flag is something of a shortcut for `module.host == "*"` and should always be equal to that. Its absence on the proxy object made the property of the global module instance visible, causing problems such as with URL reporting in mod_http
author Kim Alvefur <zash@zash.se>
date Mon, 04 Apr 2022 18:44:57 +0200
parent 12275:13624194984b
child 12972:ead41e25ebc0
comparison
equal deleted inserted replaced
12448:fb7e76c1ad1c 12450:7efd4bcaa95c
187 elseif modulemap["*"][module_name] then 187 elseif modulemap["*"][module_name] then
188 local mod = modulemap["*"][module_name]; 188 local mod = modulemap["*"][module_name];
189 if module_has_method(mod, "add_host") then 189 if module_has_method(mod, "add_host") then
190 local _log = logger.init(host..":"..module_name); 190 local _log = logger.init(host..":"..module_name);
191 local host_module_api = setmetatable({ 191 local host_module_api = setmetatable({
192 global = false,
192 host = host, event_handlers = new_multitable(), items = {}; 193 host = host, event_handlers = new_multitable(), items = {};
193 _log = _log, log = function (self, ...) return _log(...); end; --luacheck: ignore 212/self 194 _log = _log, log = function (self, ...) return _log(...); end; --luacheck: ignore 212/self
194 },{ 195 },{
195 __index = modulemap["*"][module_name].module; 196 __index = modulemap["*"][module_name].module;
196 }); 197 });