mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Ignore parse errors in HttpPutFormContentFilter
Errors when parsing the request content-type, in order to find out if the request has form content, are translated to false. Issue: SPR-9769
This commit is contained in:
+7
-3
@@ -87,14 +87,18 @@ public class HttpPutFormContentFilter extends OncePerRequestFilter {
|
||||
else {
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean isFormContentType(HttpServletRequest request) {
|
||||
String contentType = request.getContentType();
|
||||
if (contentType != null) {
|
||||
MediaType mediaType = MediaType.parseMediaType(contentType);
|
||||
return (MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType));
|
||||
try {
|
||||
MediaType mediaType = MediaType.parseMediaType(contentType);
|
||||
return (MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType));
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user