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

add SizeLimitHandler to Jetty-12 #10071

Merged
merged 3 commits into from
Jul 14, 2023

Conversation

lachlan-roberts
Copy link
Contributor

adapt the SizeLimitHandler from jetty 9.4 to the Jetty 12 core Handler style

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

This looks good, but can you also add a test where this is put inside an ee10 ServletContextHandler, perhaps with a GzipHandler also in the context. It is not needed to test this handler, but I want to make sure we test the ability to nest core handlers inside ee10 contexts. We probably also need to work out simple methods to configure/deploy

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

almost! one more thing!

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException
{
String requestContent = IO.toString(req.getInputStream());
resp.getWriter().print(requestContent);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to test both if the size limit is broken incrementally and if it is broken by an initial large write.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do have this test, but not in the servlet version of the test using GZIP.
It is in SizeLimitHandlerTest.

@lachlan-roberts lachlan-roberts merged commit 993a111 into jetty-12.0.x Jul 14, 2023
2 checks passed
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-sizeLimitHandler branch July 14, 2023 06:37
@lachlan-roberts lachlan-roberts added the Sponsored This issue affects a user with a commercial support agreement label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsored This issue affects a user with a commercial support agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants