Defensively ignore multipart parsing failure in case of error dispatch

Issue: SPR-15231
(cherry picked from commit d44325e)
This commit is contained in:
Juergen Hoeller 2017-02-13 15:06:52 +01:00
parent 4f52174674
commit 4d2360e5b5
1 changed files with 12 additions and 1 deletions

View File

@ -1096,7 +1096,18 @@ public class DispatcherServlet extends FrameworkServlet {
"skipping re-resolution for undisturbed error rendering"); "skipping re-resolution for undisturbed error rendering");
} }
else { else {
return this.multipartResolver.resolveMultipart(request); try {
return this.multipartResolver.resolveMultipart(request);
}
catch (MultipartException ex) {
if (request.getAttribute(WebUtils.ERROR_EXCEPTION_ATTRIBUTE) != null) {
logger.debug("Multipart resolution failed for error dispatch", ex);
// Keep processing error dispatch with regular request handle below
}
else {
throw ex;
}
}
} }
} }
// If not returned before: return original request. // If not returned before: return original request.