Copilot commented on code in PR #12759:
URL: https://github.com/apache/apisix/pull/12759#discussion_r2844116503


##########
t/APISIX.pm:
##########
@@ -271,9 +271,34 @@ deployment:
 _EOC_
     }
 
+    my $extra_lua_path = "";
+    my $extra_lua_cpath = "";
+
+    # Method 1: Block definition (preferred)
+    if ($block->extra_lua_path) {
+        $extra_lua_path = $block->extra_lua_path . ";";

Review Comment:
   The code unconditionally appends a semicolon to the extra_lua_path value. If 
a user provides a path that already ends with a semicolon (e.g., 
`/custom/path/?.lua;`), this will result in a double semicolon 
(`/custom/path/?.lua;;`). While this is not harmful in practice (double 
semicolons in Lua package paths just add the default path), it's inconsistent 
with the runtime behavior in apisix/cli/ops.lua which checks if the path 
already ends with a semicolon before appending one.
   
   Consider checking if the path already ends with a semicolon before 
appending, similar to the runtime implementation. The same applies to 
extra_lua_cpath on line 282.



-- 
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