You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/24 12:41:41 UTC

[GitHub] [apisix] Firstsawyou commented on a change in pull request #2270: feature: support `consumer_name` as key of `limit-req` plugin.

Firstsawyou commented on a change in pull request #2270:
URL: https://github.com/apache/apisix/pull/2270#discussion_r494284498



##########
File path: apisix/plugins/limit-req.lua
##########
@@ -67,7 +67,17 @@ function _M.access(conf, ctx)
         return 500
     end
 
-    local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version
+    local key
+    if conf.key == "consumer_name" then
+        if not ctx.consumer_id then
+            core.log.error("Missing consumer's username.")

Review comment:
       sorry, it's fixed now.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org