mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-14 00:41:35 +08:00
fix: correct the return value checking of pcall, since apisix_ngx_cli… (#4606)
This commit is contained in:
parent
3f295731b5
commit
503adc0f35
@ -16,7 +16,7 @@
|
||||
--
|
||||
local require = require
|
||||
local core = require("apisix.core")
|
||||
local _, apisix_ngx_client = pcall(require, "resty.apisix.client")
|
||||
local ok, apisix_ngx_client = pcall(require, "resty.apisix.client")
|
||||
local tonumber = tonumber
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ end
|
||||
|
||||
|
||||
function _M.rewrite(conf, ctx)
|
||||
if not apisix_ngx_client then
|
||||
if not ok then
|
||||
core.log.error("need to build APISIX-OpenResty to support client restriction")
|
||||
return 503
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user