chore: `limit-req` plugin code optimization
Issue description
This part of the code ( https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L70-L80)
can be replaced with "local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version" .
Issue description
This part of the code ( https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L70-L80) can be replaced with "
local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version" . If i want to use service_name to limit,i just modify key;just like so
with "
local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version" .
this style can support service_id and consumer_id at the same time. @LY-GO
with "
local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version" .this style can support
service_idandconsumer_idat the same time. @LY-GO That means that i don't need to restart to define key,i can directly use original way to accomplish my demand;But other plugins,just like limit-conn and limit-count ,is ok?
That means that i don't need to restart to define key,i can directly use original way to accomplish my demand;But other plugins,just like limit-conn and limit-count ,is ok?
the defined key is a whitelist, we need to enable it first.
and then we can use service_id or consumer_id.
the current code style, we can remove those, they are useless now. https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L71-L78
