Skip to content

Fixes #25829 by changing the check away from instanceof. Now checking… #25830

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

Closed
wants to merge 1 commit into from
Closed

Conversation

JWThewes
Copy link

Fixes #25829 by changing the check away from instanceof. Now checking…… if the request has parts. If this is the case we extract them otherwise use getFile(). Test is added for verification.

… if the request has parts. If this is the case we extract them otherwise use getFile(). Test is added for verification.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 28, 2020
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Sep 29, 2020
@jhoeller
Copy link
Contributor

I eventually went with a different approach, preserving the StandardMultipartHttpServletRequest driven preference for Part resolution but also generally falling back to Part resolution at the end (after trying Spring's MultipartRequest API). The problem here is that HttpServletRequest.getParts() may trigger server-driven parsing of the multipart request even when Spring's multipart abstraction uses Commons FileUpload, so a straight initial attempt might interfere with our abstracted processing.

Thanks for the pull request, in any case!

@jhoeller jhoeller closed this Oct 12, 2020
@JWThewes
Copy link
Author

Thanks for explaining the chosen approach! Always nice to learn more about the backgrounds.

@JWThewes JWThewes deleted the issue25829 branch October 12, 2020 18:12
@bclozel bclozel removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot test @RequestPart multipart controllers with Servlet MockPart
5 participants