Skip to content

Commit

Permalink
fix: correct the return value checking of pcall, since apisix_ngx_cli… (
Browse files Browse the repository at this point in the history
  • Loading branch information
RocFang authored Jul 16, 2021
1 parent 3f29573 commit 503adc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apisix/plugins/client-control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 503adc0

Please sign in to comment.