chore: fix function name typo in ip-restriction (#1586)

This commit is contained in:
罗泽轩 2020-05-14 17:47:09 +08:00 committed by GitHub
parent 89baaeabab
commit 3ad79cccea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
@ -128,7 +128,7 @@ 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
@ -136,7 +136,7 @@ function _M.access(conf, ctx)
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