Baoyuantop commented on code in PR #13790:
URL: https://github.com/apache/apisix/pull/13790#discussion_r4284582092


##########
apisix/plugin.lua:
##########
@@ -533,7 +533,8 @@ local function meta_filter(ctx, plugin_name, plugin_conf)
 
     local match_cache_key =
         ctx.conf_type .. "#" .. ctx.conf_id .. "#"
-            .. ctx.conf_version .. "#" .. plugin_name .. "#meta_filter_matched"
+            .. ctx.conf_version .. "#" .. plugin_name .. "#"

Review Comment:
   before_proxy runs in access after other plugin hooks, but reuses their 
cached meta_filter verdict. Filters on values that change within access or 
between response chunks remain fixed; review whether that matches the intended 
contract.



##########
apisix/plugin.lua:
##########
@@ -533,7 +533,8 @@ local function meta_filter(ctx, plugin_name, plugin_conf)
 
     local match_cache_key =
         ctx.conf_type .. "#" .. ctx.conf_id .. "#"
-            .. ctx.conf_version .. "#" .. plugin_name .. "#meta_filter_matched"
+            .. ctx.conf_version .. "#" .. plugin_name .. "#"
+            .. ngx.get_phase() .. "#meta_filter_matched"

Review Comment:
   Existing response-filter tests cover header filtering, not a logger 
evaluated in both access and log. No added test guards the phase-specific 
verdict or the logged $status value.



##########
apisix/plugin.lua:
##########
@@ -533,7 +533,8 @@ local function meta_filter(ctx, plugin_name, plugin_conf)
 
     local match_cache_key =
         ctx.conf_type .. "#" .. ctx.conf_id .. "#"
-            .. ctx.conf_version .. "#" .. plugin_name .. "#meta_filter_matched"
+            .. ctx.conf_version .. "#" .. plugin_name .. "#"
+            .. ngx.get_phase() .. "#meta_filter_matched"

Review Comment:
   With a status-filtered logger, meta_filter skips request-body reading in 
access but enables logging for an early error. The resulting log omits the 
configured request body because no earlier phase read 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to