Skip to content

Ignore multipart failures during error dispatch - #37714

Closed
jimi-21 wants to merge 1 commit into
spring-projects:mainfrom
jimi-21:fix/multipart-error-dispatch
Closed

jimi-21 wants to merge 1 commit into
spring-projects:mainfrom
jimi-21:fix/multipart-error-dispatch

Conversation

@jimi-21

@jimi-21 jimi-21 commented Nov 18, 2026

Copy link
Copy Markdown

Summary

  • Ignore multipart resolution failures for every ERROR dispatch, including sendError() without an exception attribute.
  • Preserve existing behavior for normal REQUEST dispatches.

Verification

  • ./gradlew :spring-webmvc:check.
  • The issue author's reproducer initially failed twice on Jetty and once on Tomcat. With this change, both containers return the intended 401 JSON error response without a secondary MultipartException.

Closes gh-37695

A sendError() dispatch may not have an error exception attribute. Do not let a secondary multipart resolution failure replace the intended error response.

Closes spring-projectsgh-37695

Signed-off-by: hejingming368-max <hejingming368@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 18, 2026
@bclozel

bclozel commented Nov 18, 2026

Copy link
Copy Markdown
Member

Issue is still being triaged. See Contributing guide at the root of the repository.

@bclozel bclozel closed this Nov 18, 2026
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sendError on a multipart request breaks the error page, as DispatcherServlet parses the body again on the error dispatch

3 participants