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 2021/11/05 01:11:43 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #5422: feat(limit-* plugin): fallback to remote_addr when key is missing

spacewander commented on a change in pull request #5422:
URL: https://github.com/apache/apisix/pull/5422#discussion_r743327859



##########
File path: apisix/plugins/limit-conn/init.lua
##########
@@ -64,10 +64,9 @@ function _M.increase(conf, ctx)
     end
 
     if key == nil then
-        core.log.info("bypass the limit conn as the key is empty")
-        -- Bypass the limit conn when the key is empty.
-        -- This behavior is the same as Nginx
-        return
+        core.log.info("The key of limit conn is empty or invalid, set $remote_addr as the key")
+        -- When the key is empty or invalid, set $remote_addr as the default key
+        key = "remote_addr"

Review comment:
       The key should be the value of remote_addr not remote_addr itself




-- 
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: notifications-unsubscribe@apisix.apache.org

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