suryaparua-official opened a new pull request, #13358:
URL: https://github.com/apache/apisix/pull/13358

   ## Summary
   
   Fixes #13357
   
   ## Changes
   
   In `apisix/plugins/limit-count/init.lua` at line 262, the `error()` 
   function was called with incorrect arguments:
   
   ```lua
   -- Before (wrong)
   error("failed to generate key invalid parent: ", core.json.encode(parent))
   
   -- After (correct)
   error("failed to generate key invalid parent: " .. core.json.encode(parent))
   ```
   
   Lua's `error(message, level)` expects the second argument to be an 
   integer (stack level: 0, 1, or 2), not a string. The previous code 
   would cause LuaJIT to raise:
   > bad argument #2 to 'error' (number expected, got string)
   
   ## Test
   
   Added a test case in `t/plugin/limit-count5.t` to verify the error 
   message is correct when `_meta.parent` is missing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to