reta commented on code in PR #3803:
URL: https://github.com/apache/cxf/pull/3803#discussion_r4744405161
##########
rt/wsdl/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java:
##########
@@ -95,14 +93,12 @@ public String getBaseURI() {
}
public InputSource getImportInputSource(String parentLocation, String
importLocation) {
- // Do a check on the scheme to see if it's anything that could be a
security risk
- try {
- URI url = new URI(importLocation);
- if (!(url.getScheme() == null ||
URIResolver.getAllowedSchemes().contains(url.getScheme()))) {
- throw new IllegalArgumentException("The " + url.getScheme() +
" URI scheme is not allowed");
- }
- } catch (URISyntaxException e) {
- // Just continue here as we might still be able to load it from
the filesystem
+ // Do a check on the scheme to see if it's anything that could be a
security risk. This also checks
+ // the location of an archive (e.g. jar:ftp://...), and does not need
the import location to parse
+ // as a URI. A relative import is resolved against its parent, which
has already been checked.
+ String scheme = URIResolver.getDisallowedScheme(importLocation, null);
Review Comment:
Let's unify API naming may be, like we have `isAllowedXxx`, let's have one
for scheme as well?
```suggestion
if (!URIResolver.isAllowedScheme(importLocation, null)) {
...
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]