envoyproxy / envoyproxy/gateway
Expose Envoy route request_body_buffer_limit separately from request buffering
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
Envoy Gateway currently exposes request body buffering through `BackendTrafficPolicy.spec.requestBuffer.limit`. This maps to the Envoy HTTP buffer filter using `envoy.filters.http.buffer` and per-route `BufferPerRoute`.
That behavior fully buffers the downstream request body before forwarding upstream. It is useful for shielding backends from slow clients and enforcing a request size cap, but it changes request forwarding semantics and is incompatible with streaming or upgrade-based traffic such as WebSocket and gRPC streaming.
Envoy also has a separate route-level [request body buffer setting](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#:~:text=request_body_buffer_limit):
```
config.route.v3.Route.request_body_buffer_limit
```
This configures the maximum request body bytes that Envoy may buffer for route behavior, including buffering beyond `per_connection_buffer_limit_bytes`. It does not require inserting the HTTP buffer filter and does not mean “fully buffer every request before forwarding upstream.”
EG does not currently expose this field. Users who only need to tune Envoy’s per-route request body buffer limit must use `requestBuffer`, which enables stronger behavior than intended and can break streaming or upgrade use cases.
**Proposed Direction**
Add a new `BackendTrafficPolicy` field, separate from `requestBuffer`, for example:
```
spec:
requestBodyBufferLimit: 10Mi
```
This should map directly to Envoy route `request_body_buffer_limit`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.