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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to