StandardServletMultipartResolver accepts any HTTP method for multipart
Issue: SPR-16975
This commit is contained in:
parent
bf5fe46fa9
commit
bac68c8d3f
|
@ -43,13 +43,12 @@ import org.springframework.web.multipart.MultipartResolver;
|
|||
*
|
||||
* <pre class="code">
|
||||
* public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
|
||||
* // ...
|
||||
* @Override
|
||||
* protected void customizeRegistration(ServletRegistration.Dynamic registration) {
|
||||
*
|
||||
* // Optionally also set maxFileSize, maxRequestSize, fileSizeThreshold
|
||||
* registration.setMultipartConfig(new MultipartConfigElement("/tmp"));
|
||||
* }
|
||||
* // ...
|
||||
* @Override
|
||||
* protected void customizeRegistration(ServletRegistration.Dynamic registration) {
|
||||
* // Optionally also set maxFileSize, maxRequestSize, fileSizeThreshold
|
||||
* registration.setMultipartConfig(new MultipartConfigElement("/tmp"));
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,12 +79,7 @@ public class StandardServletMultipartResolver implements MultipartResolver {
|
|||
|
||||
@Override
|
||||
public boolean isMultipart(HttpServletRequest request) {
|
||||
// Same check as in Commons FileUpload...
|
||||
if (!"post".equalsIgnoreCase(request.getMethod())) {
|
||||
return false;
|
||||
}
|
||||
String contentType = request.getContentType();
|
||||
return StringUtils.startsWithIgnoreCase(contentType, "multipart/");
|
||||
return StringUtils.startsWithIgnoreCase(request.getContentType(), "multipart/");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue