fix: correct the return value checking of pcall, since apisix_ngx_cli… (#4606)

This commit is contained in:
RocFang 2021-07-16 10:18:12 +08:00 committed by GitHub
parent 3f295731b5
commit 503adc0f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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