Repository navigation
jetty: apply maxRequestSize to chunked request bodies - #4054
Closed
shawzyy457 wants to merge 1 commit into
Closed
shawzyy457 wants to merge 1 commit into
shawzyy457 wants to merge 1 commit into
Conversation
…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
force-pushed
the
4053-chunked-max-request-size
branch
from
November 27, 2026 09:55
e026341 to
a02eda2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JettyContext.body()wrapped the request stream inLimitedInputStreamonly when the declared length was at leastmaxRequestSize. A chunked body reports -1, so it was read with no limit. The wrapper now also applies when the length is unknown.Issue4053sends 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
testsandjooby-jettymodules. Everything passes except 15 tests inIssue3508,Issue3508ProblemDetailsandIssue3936, which fail the same way onmainbecause the machine locale is pt_PT and the validator messages come out in Portuguese. With-Duser.language=en -Duser.country=USthey pass too.Fixes #4053