Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
王博
kong-plugin
Commits
b2fb1546
Commit
b2fb1546
authored
6 years ago
by
Thijs Schreijer
Browse files
Options
Download
Email Patches
Plain Diff
fix(handler) fix copy-paste errors
parent
376ddaa7
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kong/plugins/myplugin/handler.lua
+13
-13
kong/plugins/myplugin/handler.lua
with
13 additions
and
13 deletions
+13
-13
kong/plugins/myplugin/handler.lua
View file @
b2fb1546
...
...
@@ -13,7 +13,7 @@ local plugin = require("kong.plugins.base_plugin"):extend()
-- constructor
function
plugin
:
new
()
plugin
.
super
.
new
(
self
,
plugin_name
)
-- do initialization here, runs in the 'init_by_lua_block', before worker processes are forked
end
...
...
@@ -32,29 +32,29 @@ end
--[[ handles more initialization, but AFTER the worker process has been forked/created.
-- It runs in the 'init_worker_by_lua_block'
function plugin:init_worker()
plugin.super.
access
(self)
plugin.super.
init_worker
(self)
-- your custom code here
end --]]
--[[ runs in the ssl_certificate_by_lua_block handler
function plugin:certificate(plugin_conf)
plugin.super.
access
(self)
plugin.super.
certificate
(self)
-- your custom code here
end --]]
--[[ runs in the 'rewrite_by_lua_block' (from version 0.10.2+)
-- IMPORTANT: during the `rewrite` phase neither the `api` nor the `consumer` will have
-- been identified, hence this handler will only be executed if the plugin is
-- been identified, hence this handler will only be executed if the plugin is
-- configured as a global plugin!
function plugin:rewrite(plugin_conf)
plugin.super.rewrite(self)
-- your custom code here
end --]]
---[[ runs in the 'access_by_lua_block'
...
...
@@ -63,12 +63,12 @@ function plugin:access(plugin_conf)
-- your custom code here
ngx
.
req
.
set_header
(
"Hello-World"
,
"this is on a request"
)
end
--]]
---[[ runs in the 'header_filter_by_lua_block'
function
plugin
:
header_filter
(
plugin_conf
)
plugin
.
super
.
access
(
self
)
plugin
.
super
.
header_filter
(
self
)
-- your custom code here, for example;
ngx
.
header
[
"Bye-World"
]
=
"this is on the response"
...
...
@@ -77,18 +77,18 @@ end --]]
--[[ runs in the 'body_filter_by_lua_block'
function plugin:body_filter(plugin_conf)
plugin.super.
access
(self)
plugin.super.
body_filter
(self)
-- your custom code here
end --]]
--[[ runs in the 'log_by_lua_block'
function plugin:log(plugin_conf)
plugin.super.
access
(self)
plugin.super.
log
(self)
-- your custom code here
end --]]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help