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

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


The following commit(s) were added to refs/heads/master by this push:
     new eba1c30d9 fix(batch-requests): ignore "unix:" in the configuration 
(#7106)
eba1c30d9 is described below

commit eba1c30d9dc3ab514256c65088e7695f9766acbf
Author: 罗泽轩 <[email protected]>
AuthorDate: Mon May 23 18:22:40 2022 +0800

    fix(batch-requests): ignore "unix:" in the configuration (#7106)
    
    Signed-off-by: spacewander <[email protected]>
---
 apisix/cli/ops.lua            | 2 +-
 t/cli/test_validate_config.sh | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/apisix/cli/ops.lua b/apisix/cli/ops.lua
index 6c5ff7675..c7af4e622 100644
--- a/apisix/cli/ops.lua
+++ b/apisix/cli/ops.lua
@@ -283,7 +283,7 @@ 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:is_loopback() or _ip:is_unspecified() then
+                if _ip and _ip:is_loopback() or _ip:is_unspecified() then
                     pass_real_client_ip = true
                 end
             end
diff --git a/t/cli/test_validate_config.sh b/t/cli/test_validate_config.sh
index 43bfd5293..2d7ba1555 100755
--- a/t/cli/test_validate_config.sh
+++ b/t/cli/test_validate_config.sh
@@ -192,6 +192,7 @@ nginx_config:
         - "0.0.0.0/0"
         - "::"
         - "::/0"
+        - "unix:"
 ' > conf/config.yaml
 
 out=$(make init 2>&1 || true)

Reply via email to