You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if proxy-cache plugins configures cache_key with ["$arg_a", "$arg_b"] and $arg_a and $arg_b are both nil, apisix will abort with error.
I think it is quite normal that api has not required args, can this line tmp[i] = ctx.var[string.sub(value, 2)] change to tmp[i] = ctx.var[string.sub(value, 2)] or ""? if it is acceptable, i would like to submit a PR.
Expected Behavior
cache_key not fail with nil variables
Error Logs
[error] 3329653#3329653: *15666726 lua entry thread aborted: runtime error: ...tion/bin/apisix/plugins/proxy-cache.lua:149: invalid value (nil) at index 2 in table for 'concat'
Steps to Reproduce
create route with proxy-cache plugin, and configure cache key with "cache_key": ["$arg_a", "$arg_b"] and then request without url args
Environment
APISIX version (run apisix version):2.11.0
Operating system (run uname -a):Linux 11-186-252-137 4.14.105-1-tlinux3-0016 change: added doc of how to load plugin. #1 SMP Fri Jul 31 16:16:47 CST 2020 x86_64 x86_64 x86_64 GNU/Linux
OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: openresty/1.19.9.1
The text was updated successfully, but these errors were encountered:
worldwonderer
changed the title
bug: iproxy-cache plugin generate_complex_value may fail due to concat nil values
bug: proxy-cache plugin generate_complex_value may fail due to concat nil values
May 30, 2022
Current Behavior
if proxy-cache plugins configures cache_key with ["$arg_a", "$arg_b"] and $arg_a and $arg_b are both nil, apisix will abort with error.
I think it is quite normal that api has not required args, can this line
tmp[i] = ctx.var[string.sub(value, 2)]
change totmp[i] = ctx.var[string.sub(value, 2)] or ""
? if it is acceptable, i would like to submit a PR.Expected Behavior
cache_key not fail with nil variables
Error Logs
[error] 3329653#3329653: *15666726 lua entry thread aborted: runtime error: ...tion/bin/apisix/plugins/proxy-cache.lua:149: invalid value (nil) at index 2 in table for 'concat'
Steps to Reproduce
create route with proxy-cache plugin, and configure cache key with
"cache_key": ["$arg_a", "$arg_b"]
and then request without url argsEnvironment
apisix version
):2.11.0uname -a
):Linux 11-186-252-137 4.14.105-1-tlinux3-0016 change: added doc of how to load plugin. #1 SMP Fri Jul 31 16:16:47 CST 2020 x86_64 x86_64 x86_64 GNU/Linuxopenresty -V
ornginx -V
):nginx version: openresty/1.19.9.1The text was updated successfully, but these errors were encountered: