-
Notifications
You must be signed in to change notification settings - Fork 2.8k
docs: improve serverless plugin example (#8980) #13051
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,8 +47,13 @@ Only Lua functions are allowed here and not other Lua code. | |||||||||
| For example, anonymous functions are legal: | ||||||||||
|
|
||||||||||
| ```lua | ||||||||||
| return function() | ||||||||||
| ngx.log(ngx.ERR, 'one') | ||||||||||
| return function(conf, ctx) | ||||||||||
| local core = require("apisix.core") | ||||||||||
| if not ngx.var.arg_name then | ||||||||||
| local uri_args = core.request.get_uri_args(ctx) | ||||||||||
|
Comment on lines
+52
to
+53
|
||||||||||
| if not ngx.var.arg_name then | |
| local uri_args = core.request.get_uri_args(ctx) | |
| local uri_args = core.request.get_uri_args(ctx) | |
| if not uri_args.name then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use core.request.set_uri_args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description/issue #8980 asks to update the serverless plugin documentation example shown under "Enable Plugin" to demonstrate URI argument manipulation, but this change only updates the earlier "anonymous functions are legal" snippet. Consider updating the "Enable Plugin" JSON example (and the later log-output text) to use this new, more meaningful function so the documentation matches the stated goal.