Skip to content

jetty: apply maxRequestSize to chunked request bodies - #4054

Closed
shawzyy457 wants to merge 1 commit into
jooby-project:mainfrom
shawzyy457:4053-chunked-max-request-size
Closed

shawzyy457 wants to merge 1 commit into
jooby-project:mainfrom
shawzyy457:4053-chunked-max-request-size

Conversation

@shawzyy457

@shawzyy457 shawzyy457 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

JettyContext.body() wrapped the request stream in LimitedInputStream only when the declared length was at least maxRequestSize. A chunked body reports -1, so it was read with no limit. The wrapper now also applies when the length is unknown.

Issue4053 sends a chunked body over and under a 16 KB limit on every server. Without the change it fails on Jetty only, with 200 instead of 413. Netty and Undertow already return 413.

Tested locally on JDK 24 with the tests and jooby-jetty modules. Everything passes except 15 tests in Issue3508, Issue3508ProblemDetails and Issue3936, which fail the same way on main because the machine locale is pt_PT and the validator messages come out in Portuguese. With -Duser.language=en -Duser.country=US they pass too.

Fixes #4053

…ject#4053

JettyContext.body() wrapped the stream in LimitedInputStream only when the
declared length reached maxRequestSize, so a chunked body (length -1) was read
with no limit. Netty and Undertow already reject it with 413.
@shawzyy457
shawzyy457 force-pushed the 4053-chunked-max-request-size branch from e026341 to a02eda2 Compare November 27, 2026 09:55
@shawzyy457 shawzyy457 closed this Nov 27, 2026
@shawzyy457
shawzyy457 deleted the 4053-chunked-max-request-size branch November 27, 2026 09:56
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.

jetty: chunked request bodies skip maxRequestSize since 4.6.0

1 participant