fix: limit_except returns 503 instead of the correct 403 (#11742)

This commit is contained in:
ZJfans 2024-08-25 01:25:31 +08:00 committed by James Strong
parent 698960e9b7
commit 72ff20ff47

View file

@ -277,6 +277,11 @@ local function get_balancer()
local backend_name = ngx.var.proxy_upstream_name
if backend_name == '-' then
ngx.status = ngx.HTTP_FORBIDDEN
return ngx.exit(ngx.status)
end
local balancer = balancers[backend_name]
if not balancer then
return nil