Skip to content

Commit

Permalink
fix(batch-requests): ignore "unix:" in the configuration (#7109)
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored May 23, 2022
1 parent 42a6f57 commit 84535af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apisix/cli/ops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/cli/test_validate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84535af

Please sign in to comment.