Skip to content

Commit

Permalink
chore: fix function name typo in ip-restriction (apache#1586)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander authored and SaberMaster committed Jun 30, 2020
1 parent 664c462 commit 901727f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apisix/plugins/ip-restriction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function _M.check_schema(conf)
end


local function create_ip_mather(ip_list)
local function create_ip_matcher(ip_list)
local ip, err = ipmatcher.new(ip_list)
if not ip then
core.log.error("failed to create ip matcher: ", err,
Expand All @@ -128,15 +128,15 @@ function _M.access(conf, ctx)

if conf.blacklist and #conf.blacklist > 0 then
local matcher = lrucache(conf.blacklist, nil,
create_ip_mather, conf.blacklist)
create_ip_matcher, conf.blacklist)
if matcher then
block = matcher:match(remote_addr)
end
end

if conf.whitelist and #conf.whitelist > 0 then
local matcher = lrucache(conf.whitelist, nil,
create_ip_mather, conf.whitelist)
create_ip_matcher, conf.whitelist)
if matcher then
block = not matcher:match(remote_addr)
end
Expand Down

0 comments on commit 901727f

Please sign in to comment.