Jetty version(s)
12.1.x
Description
EagerContentHandler sends 500 response when the content size limits are exceeeded.
The response codes for this should be 413 or 400, not 500.
In the ServletApiRequest this is not an issue because of the following code
try
{
...
_contentParameters = FormFields.getFields(getRequest(), maxKeys, maxContentSize);
}
catch (IllegalStateException | IllegalArgumentException | CompletionException e)
{
throw new HttpException.IllegalStateException(HttpStatus.BAD_REQUEST_400, "Unable to parse form content", e);
}
However this is not done for EagerContentHandler.FormContentLoaderFactory.
2026-06-05 15:13:12.525:WARN :oejs.Response:qtp3540494-59: writeError: status=500, message=java.lang.IllegalStateException: form too large > 15, response=org.eclipse.jetty.ee11.servlet.ServletContextResponse@682e5026
java.lang.IllegalStateException: form too large > 15
at org.eclipse.jetty.server.FormFields.<init>(FormFields.java:373)
at org.eclipse.jetty.server.FormFields.from(FormFields.java:335)
at org.eclipse.jetty.server.FormFields.onFields(FormFields.java:226)
at org.eclipse.jetty.server.handler.EagerContentHandler$FormContentLoaderFactory$1.load(EagerContentHandler.java:331)
at org.eclipse.jetty.server.handler.EagerContentHandler.onConditionsMet(EagerContentHandler.java:161)
Jetty version(s)
12.1.x
Description
EagerContentHandlersends500response when the content size limits are exceeeded.The response codes for this should be
413or400, not500.In the ServletApiRequest this is not an issue because of the following code
However this is not done for
EagerContentHandler.FormContentLoaderFactory.