Skip to content

Commit 1ba7731

Browse files
committed
Merge branch '6.1.x'
2 parents 081d0b3 + 4a81f2c commit 1ba7731

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
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)