monkeyDluffy6017 commented on code in PR #10485:
URL: https://github.com/apache/apisix/pull/10485#discussion_r1392077831


##########
apisix/core/utils.lua:
##########
@@ -292,11 +292,16 @@ local resolve_var
 do
     local _ctx
     local n_resolved
-    local pat = [[(?<!\\)\$\{?(\w+)\}?]]
+    local pat = [[(?<!\\)\$(\{(\w+)\}|(\w+))]]
     local _escaper
 
     local function resolve(m)
-        local v = _ctx[m[1]]
+        local i = 1
+        -- if first capture's first char is "{" evaluate the second capture
+        if m[1]:byte(1) == 123 then
+            i = 2
+        end
+        local v = _ctx[m[i]]

Review Comment:
   Why do you add this?



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