shreemaan-abhishek opened a new pull request, #13906:
URL: https://github.com/apache/apisix/pull/13906

   ### Description
   
   The `batch-requests` endpoint retains pipeline response bodies before 
serializing the aggregate. Large responses can make the total buffered data 
grow well beyond the input size.
   
   This change:
   
   - adds `max_response_body_size` (1 MiB by default) and 
`max_response_body_size_total` (10 MiB by default) to plugin metadata
   - checks `Content-Length` before reading when it is available and enforces 
both limits while reading chunks
   - closes the pipeline connection and returns 502 with the pipeline item 
index when either limit is reached
   - adds coverage for per-item, aggregate, exact-boundary, and metadata 
validation behavior
   
   #### Behavior change and metadata configuration
   
   This intentionally changes behavior for pipelines whose response bodies 
exceed the new defaults: they now return 502 instead of returning the full 
aggregate. Existing plugin metadata needs no data migration because the new 
fields use defaults when absent. Deployments that depend on larger response 
bodies should set `max_response_body_size` and `max_response_body_size_total` 
in `batch-requests` plugin metadata before rollout.
   
   #### Which issue(s) this PR fixes:
   
   N/A
   
   ### Tests
   
   - `luacheck apisix/plugins/batch-requests.lua`
   - `APISIX_HOME=/tmp/brl-apisix 
TEST_NGINX_SERVROOT=/tmp/brl-apisix/t/servroot prove -I. 
t/plugin/batch-requests.t`
   - `git diff --check`
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


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