nic-6443 opened a new pull request, #13345:
URL: https://github.com/apache/apisix/pull/13345

   ### Description
   
   When a global rule plugin reads the request body in the access phase (e.g., 
loggers with `include_req_body=true`), and `client-control` with a larger 
`max_body_size` is configured on the route or service, the logger's 
`ngx.req.read_body()` triggers nginx's body size check **before** 
`client-control` gets a chance to set the FFI override in the rewrite phase, 
resulting in a false 413 rejection.
   
   The root cause is that `run_global_rules()` runs both rewrite and access 
phases together before route/service plugins execute their rewrite phase.
   
   ### Changes
   
   Split `run_global_rules` in `http_access_phase` so that the phases 
interleave correctly:
   
   1. Global rules **rewrite** runs first
   2. Route/service plugins **rewrite** runs — `client-control` sets FFI 
override here
   3. Global rules **access** runs — logger reads body with correct limit
   4. Route/service plugins **access** runs
   
   Also adds phase-specific tracer span names (`run_global_rules.rewrite` / 
`run_global_rules.access`) for better observability.
   
   ### Behavioral notes
   
   - For the no-route-match path, global rules still run combined (rewrite + 
access together) since there are no route/service plugins to interleave with.
   - Global rule plugins that only have an `access` handler (e.g., 
`consumer-restriction`) now run after consumer merge, which means they can 
correctly access consumer info — previously this was a no-op on global rules.


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