Current Behavior
The filters in the plugin support only Nginx variables, not APISIX's built-in variables.
For example, I can use the Nginx variable http_xxx, but I can't use APISIX custom variables like arg_xxxx or graphql_xxxx.
Expected Behavior
It can support all APISIX variable syntax, including cookie_xxxx, arg_xxxx, post_arg_xxxx, graphql_xxxx, etc.
Error Logs
No response
Steps to Reproduce
- Set the filter in the plugin to use the above unsupported syntax.
The reason is that we didn't pass in our ctx for that expr executor, and the expr uses its default ngx.var, which wouldn't support extended syntax.
https://github.com/apache/apisix/blob/master/apisix/plugin.lua#L437
https://github.com/api7/lua-resty-expr/blob/main/lib/resty/expr/v1.lua#L376
We just need to change it to ok, err = ex:eval(ctx.var) and it will support those extended syntaxes.
Environment
- APISIX version (run
apisix version): 3.0.0
Current Behavior
The filters in the plugin support only Nginx variables, not APISIX's built-in variables.
For example, I can use the Nginx variable
http_xxx, but I can't use APISIX custom variables likearg_xxxxorgraphql_xxxx.Expected Behavior
It can support all APISIX variable syntax, including
cookie_xxxx,arg_xxxx,post_arg_xxxx,graphql_xxxx, etc.Error Logs
No response
Steps to Reproduce
The reason is that we didn't pass in our ctx for that expr executor, and the expr uses its default
ngx.var, which wouldn't support extended syntax.https://github.com/apache/apisix/blob/master/apisix/plugin.lua#L437
https://github.com/api7/lua-resty-expr/blob/main/lib/resty/expr/v1.lua#L376
We just need to change it to
ok, err = ex:eval(ctx.var)and it will support those extended syntaxes.Environment
apisix version): 3.0.0