Skip to content

Commit

Permalink
typo: fixed typo about function. (#2007)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonming authored Aug 6, 2020
1 parent ac69ad3 commit 23bc76b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions apisix/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions apisix/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions t/script/script_distribute.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23bc76b

Please sign in to comment.