-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(conf): configurable max for request headers, response headers, uri args, post args and decode args for lua #10443
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
577afef
to
acb4786
Compare
4d41865
to
9629d81
Compare
9629d81
to
01e4bda
Compare
09b6212
to
22b1b50
Compare
hbagdi
reviewed
Mar 9, 2023
hbagdi
reviewed
Mar 9, 2023
hbagdi
reviewed
Mar 9, 2023
hbagdi
reviewed
Mar 9, 2023
22b1b50
to
ed6f997
Compare
4b74484
to
f1383c0
Compare
b67d0f7
to
32ab9eb
Compare
jschmid1
reviewed
Mar 20, 2023
### Summary Just localizes some functions in request module. The most of them were already localized, but this adds the rest.
### Summary Adds is_trusted_ip() helper function to request module. There were some repetitive code.
### Summary If `kong.request.get_uri_args` is called multiple times in request, the table returned by it is now cached to request context and reused when called again.
### Summary On my Mac the `os.execute("echo -n '' > " .. FILE_LOG_PATH)` was creating files that contained `-n`, which is really strange. We have a helper to cleanup log files, so lets just use it instead.
### Summary Just fixes the indentation in kong response pdk module.
### Summary Previously the code was using `ngx.re.gsub` for simple `-` to `_` conversion on input strings. For HTTP module it uses `resty.core.utils.str_replace_char`. For stream module this is not currently needed here. The already fast replacement logic is now about the 5 times faster. Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
…ri args, post args and decode args for lua ### Summary Adds new `kong.conf` configuration settings: - `lua_max_req_headers` (affects `kong.request.get_headers()` and `ngx.req.get_headers()`, does not affect proxying) - `lua_max_resp_headers` (affects `kong.response.get_headers()` and `kong.service.response.get_headers()` and `ngx.resp.get_headers()`, does not affect proxying) - `lua_max_uri_args` (affects `kong.request.get_query()`, `kong.request.get_query_arg()`, `ngx.req.get_uri_args()`, does not affect proxying) - `lua_max_post_args` (affects `kong.request.get_body()` and `ngx.req.get_post_args()`, does not affect proxying) And changes Kong to use those defaults. This PR also contains some style/perf commits. I suggest this to be reviewed `commit-by-commit`. Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
d4ef4ec
to
c6dea45
Compare
jschmid1
approved these changes
Mar 20, 2023
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.
approved, granted the tests pass
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds new
kong.conf
configuration settings:lua_max_req_headers
(affectskong.request.get_headers()
andngx.req.get_headers()
, does not affect proxying)lua_max_resp_headers
(affectskong.response.get_headers()
andkong.service.response.get_headers()
andngx.resp.get_headers()
, does not affect proxying)lua_max_uri_args
(affectskong.request.get_query()
,kong.request.get_query_arg()
,ngx.req.get_uri_args()
, does not affect proxying)lua_max_post_args
(affectskong.request.get_body()
andngx.req.get_post_args()
, does not affect proxying)And changes Kong to use those defaults.
This PR also contains some style/perf commits. I suggest this to be reviewed
commit-by-commit
.KAG-715
Issues Resolved
Fix #10324