typo: fixed typo about function. (#2007)

This commit is contained in:
Wen Ming 2020-08-06 16:06:52 +08:00 committed by GitHub
parent ac69ad3e3a
commit 23bc76b5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 14 deletions

View File

@ -126,9 +126,9 @@ local function run_plugin(phase, plugins, api_ctx)
and phase ~= "body_filter"
then
for i = 1, #plugins, 2 do
local phase_fun = plugins[i][phase]
if phase_fun then
local code, body = phase_fun(plugins[i + 1], api_ctx)
local phase_func = plugins[i][phase]
if phase_func then
local code, body = phase_func(plugins[i + 1], api_ctx)
if code or body then
core.response.exit(code, body)
end
@ -138,9 +138,9 @@ local function run_plugin(phase, plugins, api_ctx)
end
for i = 1, #plugins, 2 do
local phase_fun = plugins[i][phase]
if phase_fun then
phase_fun(plugins[i + 1], api_ctx)
local phase_func = plugins[i][phase]
if phase_func then
phase_func(plugins[i + 1], api_ctx)
end
end

View File

@ -47,9 +47,9 @@ function _M.run(phase, api_ctx)
core.log.info("loaded script_obj: ", core.json.delay_encode(obj, true))
local phase_fun = obj[phase]
if phase_fun then
phase_fun(api_ctx)
local phase_func = obj[phase]
if phase_func then
phase_func(api_ctx)
end
return api_ctx

View File

@ -74,11 +74,11 @@ hello world
[error]
--- error_log
string "route#1"
phase_fun(): hit access phase
phase_fun(): hit header_filter phase
phase_fun(): hit body_filter phase
phase_fun(): hit body_filter phase
phase_fun(): hit log phase while
phase_func(): hit access phase
phase_func(): hit header_filter phase
phase_func(): hit body_filter phase
phase_func(): hit body_filter phase
phase_func(): hit log phase while