Defensively ignore multipart parsing failure in case of error dispatch

Issue: SPR-15231
This commit is contained in:
Juergen Hoeller 2017-02-13 15:06:52 +01:00
parent 2ac08afab5
commit d44325ec91
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");
}
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.