-
Notifications
You must be signed in to change notification settings - Fork 611
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
Xml content type fix #760
Xml content type fix #760
Conversation
… work for content-types with charset (e.g. "text/xml;charset=UTF-8").
@@ -628,7 +630,15 @@ public void setEditable(boolean enabled) { | |||
|
|||
@Override | |||
public int getSupportScoreForContentType(String contentType ) { | |||
return contentType.toLowerCase().endsWith("xml")? 2 : 0; | |||
if(contentType.endsWith("xml")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the standard behaviour for application/xml
or else.
if(contentType.endsWith("xml")){ | ||
return 2; | ||
} | ||
Optional<String> any = Arrays.stream(contentType.split(";")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is other stuff like charset or boundard or both, we get rid of that and do the check again.
…t already in the stream
Alternative soloution to
#725
We split the content type header with ";" and get rid off the charset and additional boundary Part.
We check for "endswith" xml instead of "contains" so we avoid to set
application/vnd.openxmlformats-officedocument. wordprocessingml.document
as a valid Type.Tested and works fine
Relates to #721