worldwonderer opened a new issue, #7167: URL: https://github.com/apache/apisix/issues/7167
### 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 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 #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 -- 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]
