Skip to content

Conversation

lachlan-roberts
Copy link
Contributor

closes #13509

Fix for multipart when used through a forward or include dispatch.

Currently ServletApiRequest does a call to ServletMultiPartFormData.getParts(this) in its getParts() implementation, and this bypasses the MULTIPART_CONFIG_ELEMENT attribute set available on the ForwardRequest/IncludeRequest wrappers.

So this PR sets the wrapped request into this request attribute WRAPPED_REQUEST_ATTRIBUTE, and then looks for this in the ServletApiRequest.getParts implementation.

I don't love this solution, so feel free to suggest a better one if you can think of one.

@lachlan-roberts lachlan-roberts self-assigned this Aug 26, 2025
@lachlan-roberts lachlan-roberts changed the base branch from jetty-12.1.x to jetty-12.0.x August 26, 2025 12:59
@lachlan-roberts lachlan-roberts changed the title Issue #13509 - Fix multipart usage with FORWARD and INCLUDE dispatch. Issue #13509 - Fix multipart usage with Servlet dispatch. Aug 27, 2025
@sbordet sbordet moved this to 👀 In review in Jetty 12.0.26 -FREEEEZING Aug 27, 2025
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.

I don't love this solution either.
I will punt to the next release cycle and have a play with this myself to see if there is something more elegant that can be done.

@lachlan-roberts lachlan-roberts moved this to 🏗 In progress in Jetty 12.0.28 Sep 24, 2025
@lachlan-roberts lachlan-roberts moved this from 🏗 In progress to 👀 In review in Jetty 12.0.28 Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

"No multipart configuration element" exception when getNamedDispatcher().forward() used
2 participants