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

parts w/o filename in Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) #33511

Closed
gbrehmer opened this issue Sep 9, 2024 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@gbrehmer
Copy link

gbrehmer commented Sep 9, 2024

Affects: 6.1.12 (but can not say since when exactly, older versions are probably also affected) + Jetty 12.0.12

Parts w/o filename in content disposition header are missing in AbstractMultipartHttpServletRequest.getMultiFileMap(). Because of this part.delete() is skipped in the resolver.
The relevant logic to filter out such parts is in

the logic to ignore parts which are not part of the filemap is here:

Should we cleanup those parts by ourself? Not sure whether there are other dependencies (why it should not be part of filemap e.g.) but our fix is currently to overwrite the StandardServletMultipartResolver and delete the part nevertheless its contained or not in the filemap)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 9, 2024
@gbrehmer gbrehmer changed the title parts mapped by @RequestPart are not cleaned from temp folder (skipped by StandardServletMultipartResolver) parts w/o Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) Sep 9, 2024
@gbrehmer gbrehmer changed the title parts w/o Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) parts w/o filename Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) Sep 9, 2024
@gbrehmer gbrehmer changed the title parts w/o filename Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) parts w/o filename in Content-Disposition header are not cleaned from temp folder (skipped by StandardServletMultipartResolver) Sep 9, 2024
@bclozel bclozel added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Sep 9, 2024
@gbrehmer
Copy link
Author

gbrehmer commented Sep 10, 2024

I see all related code parts are VERY old, but I guess temp folder issues are sometimes hard to find, because normally temp folders are cleaned automatically on next boot. We found it because we limited the space for temp folder to a very low size (500M) when we normally have no big uploads or file generations.
To fix the problem it would be enough to remove one of the mentioned checks/filters ;) But of course I have not all required informations/experiences with other servlet containers/use cases/corner cases etc. to make a decision like that

@bclozel bclozel added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 23, 2024
@bclozel bclozel added this to the 6.1.15 milestone Oct 23, 2024
@bclozel
Copy link
Member

bclozel commented Oct 23, 2024

This is due to #13937. In the meantime, I don't think Resin is still supported here (because there is no Jakarta release available), so I guess we can revert this workaround.

@bclozel bclozel self-assigned this Oct 23, 2024
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) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants