Skip to content

envoy: the body limit is applied before the filters that wait, and a plain route states its largest body with max_request_bytes - #84

Merged
tudor-pop merged 1 commit into
masterfrom
83-body-limit-order
Dec 4, 2026
Merged

tudor-pop merged 1 commit into
masterfrom
83-body-limit-order

Conversation

@tudor-pop

Copy link
Copy Markdown
Contributor

Closes #83

The Envoy output applies a request limit before the filters that can hold a request while they wait for an answer, and a plain route can state its largest body.

  • The filter's place. The buffer filter, which holds the limit of each method and route that writes one, is listed right before the first of the check of an origin no list holds (ask_unlisted), the token filter (auth.jwt) and the auth check (auth.ask) that the file writes. A request over a limit is answered before any of them is asked about it, and no service receives it. A file that writes none of the three lists the filter where 2.4.0 did.
  • A route's limit. routes[].max_request_bytes, a whole number from 1 to 4294967295, is the largest request body a plain route takes, in bytes as the proxy receives it. The Envoy output turns on the buffer filter on the route with the limit as written; a larger body is answered 413 before the service reads any of it. The route refuses no other form of request and adds no route before its own.
  • nginx and HAProxy refuse the key; the format's known keys, the schema, the examples and the docs name it.
  • After the upgrade. An Envoy file that sets max_request_bytes on a method and writes auth.ask, auth.jwt or an environment's ask_unlisted renders differently from 2.4.0 and is rendered again (docs/format.md, "After 2.4.0"). Every other file renders byte for byte as 2.4.0 renders it, for each target.
  • docs/limits.md states what the limit holds and what it does not.
  • The conformance battery, on Envoy 1.40.2, checks each answer: the request-limit scenario has 30 rows, the new request-limit-keys one 23 and the new route-limit one 8.
  • The README and the docs name release 2.5.0, which is tagged on this merge.

One independent review of the pushed branch and one round of corrections, built tests first. The findings and what was changed for each are in the issue.

Run locally at this tree: go test ./... with no failing package, gofmt -l printing nothing, both go vet runs, scripts/validate-envoy.sh on all 26 examples, the site build and its check, and the conformance battery's request-limit (30 rows), request-limit-keys (23), route-limit (8) and full (the two limit scenarios, 36 rows) on Envoy 1.40.2. Not run locally: the whole battery and the nginx and HAProxy validators, which the required check runs. The branch is squashed onto master with its tree unchanged.

…and a plain route states its largest body with max_request_bytes (Part of #83)

The Envoy output lists the buffer filter, which holds the limit of each
method and route that writes one, right before the first filter the file
writes that can hold a request while it waits for an answer: the check of an
origin no list holds (`ask_unlisted`), the token filter (`auth.jwt`) and the
auth check (`auth.ask`). A request over a limit is answered before any of
them is asked about it, and no service receives it. A file that writes none
of the three lists the filter where 2.4.0 did, right before the Connect
bridge, or before the router without one.

A plain route can state the largest request body it takes, in bytes:
`routes[].max_request_bytes`, a whole number from 1 to 4294967295. The Envoy
output turns on the buffer filter on the route with the limit as written,
because a plain route's body carries no gRPC prefix; a larger body is
answered 413 before the service reads any of it. The route refuses no other
form of request and adds no route before its own. A route that does not
write the key has no limit.

The nginx and HAProxy outputs refuse the key.

An Envoy file that sets `max_request_bytes` on a method and writes
`auth.ask`, `auth.jwt` or an environment's `ask_unlisted` renders differently
from 2.4.0 and is rendered again after the upgrade (docs/format.md, "After
2.4.0"). Every other file renders byte for byte as 2.4.0 renders it.

docs/limits.md states what the limit holds and what it does not. The
conformance battery checks each answer on Envoy 1.40.2 in two new scenarios
and more rows of the request-limit one.

The README and the docs name release 2.5.0.
@tudor-pop
tudor-pop merged commit 9291b49 into master Dec 4, 2026
1 check passed
@tudor-pop
tudor-pop deleted the 83-body-limit-order branch December 4, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply the body limit before filters that can hold a request, and let a plain route set one

1 participant