leslie-tsang commented on a change in pull request #5941:
URL: https://github.com/apache/apisix/pull/5941#discussion_r776125463



##########
File path: apisix/core/ctx.lua
##########
@@ -215,11 +215,18 @@ do
                 key = sub_str(key, 9)
                 val = get_parsed_graphql()[key]
 
-            elseif apisix_var_names[key] then
-                val = ngx.ctx.api_ctx and ngx.ctx.api_ctx[key]
-
             else
-                val = get_var(key, t._request)
+                local getter = apisix_var_names[key]
+                if getter then
+                    if getter == true then
+                        val = ngx.ctx.api_ctx and ngx.ctx.api_ctx[key]
+                    else
+                        val = getter(ngx.ctx.api_ctx)

Review comment:
       Maybe we should add a comment here, to notify developer where the 
`getter` from ?




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