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 2022/10/23 09:43:24 UTC

[GitHub] [apisix] membphis commented on a diff in pull request #8149: perf: allow skip header filter and body filter

membphis commented on code in PR #8149:
URL: https://github.com/apache/apisix/pull/8149#discussion_r1002676160


##########
apisix/plugins/ai.lua:
##########
@@ -19,10 +19,11 @@ local apisix          = require("apisix")
 local core            = require("apisix.core")
 local router          = require("apisix.router")
 local event           = require("apisix.core.event")
-local load_balancer   = require("apisix.balancer")
 local balancer        = require("ngx.balancer")
+local ngx             = ngx
 local is_http         = ngx.config.subsystem == "http"
 local enable_keepalive = balancer.enable_keepalive and is_http
+local is_apisix_or, response = pcall(require, "resty.apisix.response")

Review Comment:
   this should be a core API



##########
apisix/plugins/ai.lua:
##########
@@ -116,7 +117,26 @@ end
 
 
 local pool_opt
-local function ai_balancer_run(route)
+local function ai_http_balancer_phase()
+    local api_ctx = ngx.ctx.api_ctx
+    if not api_ctx then
+        core.log.error("invalid api_ctx")
+        return core.response.exit(500)
+    end
+
+    if is_apisix_or then
+        local ok, err = response.skip_header_filter_by_lua()

Review Comment:
   Only the current request skips the ***_filter, all right?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org