Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SizeLimitHandler #8774

Merged
merged 8 commits into from
Oct 31, 2022
Merged

Added SizeLimitHandler #8774

merged 8 commits into from
Oct 31, 2022

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Oct 27, 2022

Add SizeLimitHandler

@gregw gregw added Enhancement Sponsored This issue affects a user with a commercial support agreement labels Oct 27, 2022
if (contentLength < 0)
contentLength = baseRequest.getHttpFields().getLongField("X-Content-Encoding");
if (contentLength > _requestLimit)
throw new BadMessageException(413, "Request Body too large");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Order of interceptors is important.
If this is after the GzipHandler then you are basing the limits on uncompressed request/response.
Before the GzipHandler and you are basing the limits on raw network bytes.
Right?
Seems like an important detail for the javadoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I removed the special handling for X-Content-Encoding, as that muddied the picture. I'll add some javadoc.

@gregw gregw marked this pull request as ready for review October 31, 2022 04:55
@gregw
Copy link
Contributor Author

gregw commented Oct 31, 2022

@lachlan-roberts can you re-review

@gregw gregw merged commit 650a2ea into jetty-9.4.x Oct 31, 2022
@gregw gregw deleted the jetty-9.4-sizeLimit branch October 31, 2022 23:32
@joakime
Copy link
Contributor

joakime commented Nov 1, 2022

Don't forget to add PRs and Issues to projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement merge-12-needed Sponsored This issue affects a user with a commercial support agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants