Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo: fixed typo about function. #2007

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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