Skip to content

Commit 4a81f2c

Browse files
committed
Remove HTTP parts workaround for Resin
A workaround was added for the Resin Servlet container in gh-13937. This avoids attempting to delete parts that are not named, because the `part.delete()` call would fail for non-file entries. This can be problematic for files that are unnamed as they might not be removed by the Framework. This commit removes this workaround as Resin is not supported anymore. Fixes gh-33511
1 parent fb0a108 commit 4a81f2c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -116,13 +116,10 @@ public MultipartHttpServletRequest resolveMultipart(HttpServletRequest request)
116116
public void cleanupMultipart(MultipartHttpServletRequest request) {
117117
if (!(request instanceof AbstractMultipartHttpServletRequest abstractMultipartHttpServletRequest) ||
118118
abstractMultipartHttpServletRequest.isResolved()) {
119-
// To be on the safe side: explicitly delete the parts,
120-
// but only actual file parts (for Resin compatibility)
119+
121120
try {
122121
for (Part part : request.getParts()) {
123-
if (request.getFile(part.getName()) != null) {
124-
part.delete();
125-
}
122+
part.delete();
126123
}
127124
}
128125
catch (Throwable ex) {

0 commit comments

Comments
 (0)