-
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
Closed
ChristophKronberger
wants to merge
4
commits into
SmartBear:next
from
ChristophKronberger:xmlContentType_fix
Closed
Xml content type fix #760
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c101713
Fixing the content-type check for XML. Checking with endsWith did not…
8ab524f
SoapUI build with the fix of the content-type check for XML.
c3610c8
Get rid off the charset and boundary part from Content-type check.
christoph-kronberger-ebcont 23dfbc1
Trim the splitted strings and get rid of toLowercase, since we do tha…
christoph-kronberger-ebcont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,9 @@ | |
import java.awt.event.MouseEvent; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import static com.eviware.soapui.support.JsonUtil.seemsToBeJsonContentType; | ||
|
||
|
@@ -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")){ | ||
return 2; | ||
} | ||
Optional<String> any = Arrays.stream(contentType.split(";")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
.map(String::toLowerCase) | ||
.filter(txt -> !txt.contains("charset")) | ||
.filter(txt -> !txt.contains("boundary")) | ||
.findAny(); | ||
return any.filter(s -> s.toLowerCase().endsWith("xml")).map(s -> 2).orElse(0); | ||
} | ||
|
||
protected ValidationError[] validateXml(String xml) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.