NIFI-344 - Validating remote process group URI in the backend

This commit is contained in:
danbress 2015-02-17 12:39:20 -05:00
parent dde5fd51a4
commit 09090825de

View File

@ -370,6 +370,10 @@ public class RemoteProcessGroupResource extends ApplicationResource {
if (uri.getScheme() == null || uri.getHost() == null) {
throw new IllegalArgumentException("The specified remote process group URL is malformed: " + requestProcessGroupDTO.getTargetUri());
}
if (!(uri.getScheme().equalsIgnoreCase("http") || uri.getScheme().equalsIgnoreCase("https"))) {
throw new IllegalArgumentException("The specified remote process group URL is invalid, only http and https are supported: " + requestProcessGroupDTO.getTargetUri());
}
// normalize the uri to the other controller
String controllerUri = uri.toString();
@ -860,6 +864,10 @@ public class RemoteProcessGroupResource extends ApplicationResource {
if (uri.getScheme() == null || uri.getHost() == null) {
throw new IllegalArgumentException("The specified remote process group URL is malformed: " + requestRemoteProcessGroup.getTargetUri());
}
if (!(uri.getScheme().equalsIgnoreCase("http") || uri.getScheme().equalsIgnoreCase("https"))) {
throw new IllegalArgumentException("The specified remote process group URL is invalid, only http and https are supported: " + requestRemoteProcessGroup.getTargetUri());
}
// normalize the uri to the other controller
String controllerUri = uri.toString();