You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2022/05/23 14:14:54 UTC

[apisix] branch release/2.14 updated: fix(batch-requests): ignore "unix:" in the configuration (#7109)

This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch release/2.14
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/release/2.14 by this push:
     new 84535aff0 fix(batch-requests): ignore "unix:" in the configuration (#7109)
84535aff0 is described below

commit 84535aff0e5bca575202df45833197958b93fe40
Author: 罗泽轩 <sp...@gmail.com>
AuthorDate: Mon May 23 22:14:50 2022 +0800

    fix(batch-requests): ignore "unix:" in the configuration (#7109)
    
    Signed-off-by: spacewander <sp...@gmail.com>
---
 apisix/cli/ops.lua            | 6 ++++--
 t/cli/test_validate_config.sh | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/apisix/cli/ops.lua b/apisix/cli/ops.lua
index 85d0d4521..098f91ff1 100644
--- a/apisix/cli/ops.lua
+++ b/apisix/cli/ops.lua
@@ -279,8 +279,10 @@ Please modify "admin_key" in conf/config.yaml .
         if real_ip_from then
             for _, ip in ipairs(real_ip_from) do
                 local _ip = cli_ip:new(ip)
-                if _ip and _ip:is_loopback() or _ip:is_unspecified() then
-                    pass_real_client_ip = true
+                if _ip then
+                    if _ip:is_loopback() or _ip:is_unspecified() then
+                        pass_real_client_ip = true
+                    end
                 end
             end
         end
diff --git a/t/cli/test_validate_config.sh b/t/cli/test_validate_config.sh
index 2d7ba1555..164d530fe 100755
--- a/t/cli/test_validate_config.sh
+++ b/t/cli/test_validate_config.sh
@@ -195,7 +195,7 @@ nginx_config:
         - "unix:"
 ' > conf/config.yaml
 
-out=$(make init 2>&1 || true)
+out=$(make init 2>&1)
 if echo "$out" | grep "missing loopback or unspecified in the nginx_config.http.real_ip_from for plugin batch-requests"; then
     echo "failed: should check the realip configuration for batch-requests"
     exit 1