Do not cache multipart MIME types in cache
Prior to this commmit, "mutipart/*" MIME types would be cached by the `MimeTypeUtils` LRU cache. Since those MIME types are likely to have random boundaries in them, they can waste space in the LRU cache. This is not improving things since we're parsing them anyway. This commit skips the caching step for all "multipart" MIME types. Fixes gh-24767
This commit is contained in:
parent
1cd0e720f7
commit
d97eabba2f
|
@ -193,6 +193,10 @@ public abstract class MimeTypeUtils {
|
|||
if (!StringUtils.hasLength(mimeType)) {
|
||||
throw new InvalidMimeTypeException(mimeType, "'mimeType' must not be empty");
|
||||
}
|
||||
// do not cache multipart mime types with random boundaries
|
||||
if (mimeType.startsWith("multipart")) {
|
||||
return parseMimeTypeInternal(mimeType);
|
||||
}
|
||||
return cachedMimeTypes.get(mimeType);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue