Skip to content
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

CommonsMultipartResolver and DEBUG logging lead to empty fileMap in MultipartHttpServletRequest #27350

Closed
katja-m-franz opened this issue Sep 2, 2021 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@katja-m-franz
Copy link

Affects:
Spring: 5.3.9 but the error also occurs in earlier Versions (i could also reproduce it with 5.2.6)

Problem:
If a CommonsMultipartResolver is used to Handle File Upload to a Spring RestController and the LogLevel of the Dispatcher Servlet is set to DEBUG a Request Containing a Multipart File leads to an empty FileMap on the MultipartHttpServletRequest. If eighter the LogLevel is not DEBUG or another Resolver is used the same Request contains a FileMap,.

Expected Behavior:
The expected behavior would be that he LogLevel and the choice of the MultipartResolver do not change the behavior and the Request should always contain a File on the MultipartHttpServletRequest.

Example Application:
I created an example Application to check the behavior here:
https://gitlab.com/katja_m_franz/springbug
It is a really small Application and i hope you can easily reproduce the described Problem. All Info on how to do that can be found on the projects readme.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 2, 2021
@rstoyanchev rstoyanchev self-assigned this Sep 14, 2021
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 14, 2021
@rstoyanchev rstoyanchev added this to the 5.3.10 milestone Sep 14, 2021
@rstoyanchev rstoyanchev added the for: backport-to-5.2.x Marks an issue as a candidate for backport to 5.2.x label Sep 14, 2021
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.2.x Marks an issue as a candidate for backport to 5.2.x labels Sep 14, 2021
@rstoyanchev rstoyanchev changed the title CommonsMultipartResolver and Dispatcher Servlet DEBUG LogLevel lead to Empty Multipart FileMap in MultipartHttpServletRequest CommonsMultipartResolver and DEBUG logging lead to empty fileMap in MultipartHttpServletRequest Sep 14, 2021
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this issue Mar 26, 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) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants