We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_meta.filter
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.
http_xxx
arg_xxxx
graphql_xxxx
It can support all APISIX variable syntax, including cookie_xxxx, arg_xxxx, post_arg_xxxx, graphql_xxxx, etc.
cookie_xxxx
post_arg_xxxx
No response
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.
ngx.var
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.
ok, err = ex:eval(ctx.var)
apisix version
The text was updated successfully, but these errors were encountered:
I will fix it later.
Sorry, something went wrong.
fix: APISIX extended variables cannot be used in _meta.filter (#8256)
4c533ba
Co-authored-by: soulbird <zhaothree@gmail.com> Fixes #8251
fix: APISIX extended variables cannot be used in _meta.filter (apac…
f8fdcc7
…he#8256) Co-authored-by: soulbird <zhaothree@gmail.com> Fixes apache#8251
c020f0e
soulbird
Successfully merging a pull request may close this issue.
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_xxxx
orgraphql_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.0The text was updated successfully, but these errors were encountered: