Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MimeTypeUtils to handle the case of only a delimiter passed [SPR-14124] #18696

spring-issuemaster opened this issue Apr 6, 2016 · 0 comments


Copy link

@spring-issuemaster spring-issuemaster commented Apr 6, 2016

Tomoya Honjo opened SPR-14124 and commented

MimeTypeUtil#parseMimeType throws java.lang.ArrayIndexOutOfBoundsException when only delimiter ";" passed as the argument. Because in the method it parse the argument by StringUtils.tokenizeToStringArray(mimeType, ";"); but, it returns an empty array only passed the delimiter, so the exception is thrown by this next line String fullType = parts[0].trim();

For such a case, there is the dedicated exception InvalidMimeTypeException which express passed mimetype string cannot be parsed, so it's better to throw the exception.

Affects: 4.1.7

Reference URL: #1016

Referenced from: commits 50c1102

1 votes, 2 watchers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.