Skip to content

Review error response codes from EagerContentHandlerΒ #15234

Closed

Description

@lachlan-roberts

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)

Activity

  1. added
    SponsoredThis issue affects a user with a commercial support agreement
    on Jun 5, 2026
  2. rock2089 commented on Jun 7, 2026

    @rock2089
  3. moved this to πŸ— In progress in Jetty 12.1.11 - FROZENon Jun 12, 2026
  4. added a commit that references this issue on Jul 2, 2026
  5. moved this from πŸ— In progress to βœ… Done in Jetty 12.1.11 - FROZENon Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugFor general bugs on Jetty sideSponsoredThis issue affects a user with a commercial support agreement

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions