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

MimeTypeUtils.parseMimeType should ignore an inner ";" inside a quoted value [SPR-14986] #19552

spring-projects-issues opened this issue Dec 6, 2016 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented Dec 6, 2016

Michal Polák opened SPR-14986 and commented

I am not able to handle a request by Spring MVC, when the request is sent with this HTTP header:

Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml;action=\"\"" 

(btw it is generated by JaxWS-RI)

I think the Content-type value is correct, see

IMHO a "quoted-string" can contain the semicolon (";")

The problem code is on the begin in the MimeTypeUtils.parseMimeType:

String[] parts = StringUtils.tokenizeToStringArray(mimeType, ";");

How to reproduce:

final String contentType = "application/xop+xml;charset=utf-8;type=\"application/soap+xml;action=\\\"\\\"\"";
final org.springframework.util.MimeType mt = org.springframework.util.MimeTypeUtils.parseMimeType(contentType);


Exception in thread "main" org.springframework.util.InvalidMimeTypeException: Invalid mime type "application/xop+xml;charset=utf-8;type="application/soap+xml;action=\"\""": Invalid token character '"' in token ""application/soap+xml"
	at org.springframework.util.MimeTypeUtils.parseMimeType(

Affects: 4.3.4

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.