Skip to content

Commit 84535af

Browse files
authored
fix(batch-requests): ignore "unix:" in the configuration (#7109)
Signed-off-by: spacewander <[email protected]>
1 parent 42a6f57 commit 84535af

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

apisix/cli/ops.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,10 @@ Please modify "admin_key" in conf/config.yaml .
279279
if real_ip_from then
280280
for _, ip in ipairs(real_ip_from) do
281281
local _ip = cli_ip:new(ip)
282-
if _ip and _ip:is_loopback() or _ip:is_unspecified() then
283-
pass_real_client_ip = true
282+
if _ip then
283+
if _ip:is_loopback() or _ip:is_unspecified() then
284+
pass_real_client_ip = true
285+
end
284286
end
285287
end
286288
end

t/cli/test_validate_config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ nginx_config:
195195
- "unix:"
196196
' > conf/config.yaml
197197

198-
out=$(make init 2>&1 || true)
198+
out=$(make init 2>&1)
199199
if echo "$out" | grep "missing loopback or unspecified in the nginx_config.http.real_ip_from for plugin batch-requests"; then
200200
echo "failed: should check the realip configuration for batch-requests"
201201
exit 1

0 commit comments

Comments
 (0)