You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/03/29 21:00:51 UTC
[GitHub] [incubator-apisix] Akayeshmantha opened a new pull request #1364:
support to run `header_filter` and `body_filter` phase for global rules.
Akayeshmantha opened a new pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364
### Issues resolved
Fix #1338
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on issue #1364: support to
run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606727040
@Akayeshmantha you need to rebase you PR after https://github.com/apache/incubator-apisix/commit/c76e7e3623f871987f006848c6c6abcb59550bdb merged
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606523059
@membphis done changes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming commented on issue #1364: support to
run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606965552
@spacewander please take a look
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] spacewander commented on a change in pull
request #1364: support to run `header_filter` and `body_filter` phase for
global rules.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#discussion_r399881931
##########
File path: lua/apisix.lua
##########
@@ -435,11 +435,41 @@ end
function _M.http_header_filter_phase()
+ local api_ctx = ngx.ctx.api_ctx
+ if not api_ctx then
+ return
+ end
+
+ if router.global_rules and router.global_rules.values
+ and #router.global_rules.values > 0
+ then
+ local plugins = core.tablepool.fetch("plugins", 32, 0)
+ for _, global_rule in ipairs(router.global_rules.values) do
+ core.table.clear(plugins)
+ plugins = plugin.filter(global_rule, plugins)
+ run_plugin("header_filter")
Review comment:
Look like we should pass the `plugins` into `run_plugin`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis merged pull request #1364: support to
run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
membphis merged pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-605911045
@spacewander @membphis
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606034284
@membphis can we merge this if its ok?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] spacewander commented on issue #1364: support to
run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-605869664
@Akayeshmantha
Maybe we can refactor the way to run global rule in log/header filter/body filter phases to use the same function?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1364: support to run `header_filter` and `body_filter` phase for global
rules.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#discussion_r400609225
##########
File path: lua/apisix.lua
##########
@@ -435,12 +435,42 @@ end
function _M.http_header_filter_phase()
- run_plugin("header_filter")
+ local api_ctx = ngx.ctx.api_ctx
+ if not api_ctx then
+ return
+ end
+
+ if router.global_rules and router.global_rules.values
+ and #router.global_rules.values > 0
+ then
+ local plugins = core.tablepool.fetch("plugins", 32, 0)
+ for _, global_rule in ipairs(router.global_rules.values) do
+ core.table.clear(plugins)
+ plugins = plugin.filter(global_rule, plugins)
+ run_plugin("header_filter", plugins, api_ctx)
+ end
Review comment:
missing release `plugins` to tablepool
https://github.com/apache/incubator-apisix/pull/1364/files#diff-1be8f7892798606be4abee3b0bc37860R492
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606743568
@membphis rebased
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on a change in pull
request #1364: support to run `header_filter` and `body_filter` phase for
global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on a change in pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#discussion_r400135615
##########
File path: lua/apisix.lua
##########
@@ -435,12 +435,42 @@ end
function _M.http_header_filter_phase()
- run_plugin("header_filter")
+ local api_ctx = ngx.ctx.api_ctx
+ if not api_ctx then
+ return
+ end
+
+ if router.global_rules and router.global_rules.values
+ and #router.global_rules.values > 0
+ then
+ local plugins = core.tablepool.fetch("plugins", 32, 0)
+ for _, global_rule in ipairs(router.global_rules.values) do
+ core.table.clear(plugins)
+ plugins = plugin.filter(global_rule, plugins)
+ run_plugin("header_filter",plugins,api_ctx)
Review comment:
oh sorry fixed it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] spacewander commented on a change in pull
request #1364: support to run `header_filter` and `body_filter` phase for
global rules.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#discussion_r400126964
##########
File path: lua/apisix.lua
##########
@@ -435,12 +435,42 @@ end
function _M.http_header_filter_phase()
- run_plugin("header_filter")
+ local api_ctx = ngx.ctx.api_ctx
+ if not api_ctx then
+ return
+ end
+
+ if router.global_rules and router.global_rules.values
+ and #router.global_rules.values > 0
+ then
+ local plugins = core.tablepool.fetch("plugins", 32, 0)
+ for _, global_rule in ipairs(router.global_rules.values) do
+ core.table.clear(plugins)
+ plugins = plugin.filter(global_rule, plugins)
+ run_plugin("header_filter",plugins,api_ctx)
Review comment:
Need a space after the comma.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-606667634
@membphis @moonming if things ok can we merge this so I can work on the other issue related to this 🙂
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on a change in pull
request #1364: support to run `header_filter` and `body_filter` phase for
global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on a change in pull request #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#discussion_r400135615
##########
File path: lua/apisix.lua
##########
@@ -435,12 +435,42 @@ end
function _M.http_header_filter_phase()
- run_plugin("header_filter")
+ local api_ctx = ngx.ctx.api_ctx
+ if not api_ctx then
+ return
+ end
+
+ if router.global_rules and router.global_rules.values
+ and #router.global_rules.values > 0
+ then
+ local plugins = core.tablepool.fetch("plugins", 32, 0)
+ for _, global_rule in ipairs(router.global_rules.values) do
+ core.table.clear(plugins)
+ plugins = plugin.filter(global_rule, plugins)
+ run_plugin("header_filter",plugins,api_ctx)
Review comment:
@spacewander oh sorry fixed it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1364: support
to run `header_filter` and `body_filter` phase for global rules.
Posted by GitBox <gi...@apache.org>.
Akayeshmantha commented on issue #1364: support to run `header_filter` and `body_filter` phase for global rules.
URL: https://github.com/apache/incubator-apisix/pull/1364#issuecomment-605872994
Sure @spacewander created a new issue #1369 since this ticket mentioned a different issue
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services