From 9e5bf4fc486527b33244ff2f929d8bfb7472d323 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 27 Apr 2022 17:18:46 +0200 Subject: core.moduleapi: Fix 'global' property via :context() - #1748 The 'global' property should reflect whether the module API instance represents the global context or a VirtualHost or Component context. However the module:context() method did not override this, leading the property of the previous module shining trough, leading to bugs in code relying on the 'global' property. See also #1736 --- core/moduleapi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/moduleapi.lua') diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 071dabc2..870a6a50 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -307,7 +307,7 @@ end function api:context(host) - return setmetatable({host=host or "*"}, {__index=self,__newindex=self}); + return setmetatable({ host = host or "*", global = "*" == host }, { __index = self, __newindex = self }); end function api:add_item(key, value) -- cgit v1.2.3