-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
devhh/spring-framework
#2Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
When using MockMultipartFile with an empty originalFilename (""), it now gets added to multi part requests just as a part, not as a file. When migrating from Spring Boot 2.3 to 2.4.1, this made my MockMvc test fail for a controller using a @RequestPart MultipartFile parameter causing a longer debugging session :-) It would be nice, if there had been a check (exception), that empty originalFilenames are no longer supported for MockMultipartFiles.
If the nullability of the originalFilename in MultipartFile is intended, org.springframework.web.multipart.support.StandardMultipartHttpServletRequest#parseRequest seems to be broken as it recognizes parts without filename not as files, so that they don't match MultipartFile parameters.
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression