Skip to content

Conversation

@tmyjoe
Copy link

@tmyjoe tmyjoe commented Mar 25, 2016

I've encounter java.lang.ArrayIndexOutOfBoundsException: when only ";" passed in Accept Header and found MimeTypeUtils throws the exception.

It think it's an unexpected behavior, so added a logic to throw the dedicated exception :)

@tmyjoe tmyjoe force-pushed the tmyjoe/polish-mimeutil branch from d899abf to b3bf6a6 Compare March 25, 2016 03:33
@tmyjoe tmyjoe force-pushed the tmyjoe/polish-mimeutil branch from b3bf6a6 to 39479f3 Compare March 25, 2016 03:35
@tmyjoe
Copy link
Author

tmyjoe commented Mar 26, 2016

I have signed and agree to the terms of the Spring Individual Contributor
License Agreement.

@rstoyanchev
Copy link
Contributor

Would you mind also creating a ticket in JIRA?

@tmyjoe
Copy link
Author

tmyjoe commented Apr 6, 2016

I've created a ticket for this.
https://jira.spring.io/browse/SPR-14124

if (!StringUtils.hasLength(mimeType)) {
throw new InvalidMimeTypeException(mimeType, "'mimeType' must not be empty");
}
if (mimeType.startsWith(";")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (parts.length == 0) {
            throw new InvalidMimeTypeException(mimeType, "'mimeType' must not be empty");
}

@rstoyanchev
Copy link
Contributor

Thanks for the PR. I've implemented as suggested by @ryanskow since that addresses the exact issue with the ArrayIndexOutOfBoundsException and more conclusively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants