diff --git a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/rest/unirest/config/UrlConfig.java b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/rest/unirest/config/UrlConfig.java index ad82e123dd..a9a9ebe525 100644 --- a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/rest/unirest/config/UrlConfig.java +++ b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/rest/unirest/config/UrlConfig.java @@ -35,10 +35,11 @@ public static final UrlConfig from(IUrlConfig other) { } public static final UrlConfigBuilder builderFrom(IUrlConfig other) { + var builder = builderFromConnectionConfig(other); if (null != other) { - return builderFrom(other).url(other.getUrl()); + builder = builder.url(other.getUrl()); } - return builderFrom(other); + return builder; } public static final UrlConfigBuilder builderFrom(IUrlConfig other, IUrlConfig overrides) { @@ -52,7 +53,7 @@ public static final UrlConfigBuilder builderFrom(IUrlConfig other, IUrlConfig ov return builder; } - public static final UrlConfigBuilder builderFrom(IConnectionConfig other) { + public static final UrlConfigBuilder builderFromConnectionConfig(IConnectionConfig other) { UrlConfigBuilder builder = UrlConfig.builder(); if ( other!=null ) { builder = builder diff --git a/fcli-core/fcli-sc-sast/src/main/java/com/fortify/cli/sc_sast/_common/session/helper/SCSastSessionDescriptor.java b/fcli-core/fcli-sc-sast/src/main/java/com/fortify/cli/sc_sast/_common/session/helper/SCSastSessionDescriptor.java index d99c703285..d6be5d6a7e 100644 --- a/fcli-core/fcli-sc-sast/src/main/java/com/fortify/cli/sc_sast/_common/session/helper/SCSastSessionDescriptor.java +++ b/fcli-core/fcli-sc-sast/src/main/java/com/fortify/cli/sc_sast/_common/session/helper/SCSastSessionDescriptor.java @@ -55,7 +55,7 @@ public class SCSastSessionDescriptor extends AbstractSessionDescriptor { public SCSastSessionDescriptor(ISCSastAndSSCUrlConfig scSastAndSscUrlConfig, ISSCCredentialsConfig credentialsConfig, char[] scSastClientAuthToken) { - this.sscUrlConfig = UrlConfig.builderFrom(scSastAndSscUrlConfig).url(scSastAndSscUrlConfig.getSscUrl()).build(); + this.sscUrlConfig = UrlConfig.builderFromConnectionConfig(scSastAndSscUrlConfig).url(scSastAndSscUrlConfig.getSscUrl()).build(); this.predefinedSscToken = credentialsConfig.getPredefinedToken(); this.scSastClientAuthToken = scSastClientAuthToken; this.cachedSscTokenResponse = getOrGenerateToken(sscUrlConfig, credentialsConfig); @@ -166,7 +166,7 @@ private static final IUrlConfig buildScSastUrlConfig(IUrlConfig sscUrlConfig, IS if (null == controllerUrl || StringUtils.isBlank(controllerUrl)) { controllerUrl = getScSastUrl(sscUrlConfig, activeToken); } - return UrlConfig.builderFrom(scSastAndSscUrlConfig).url(controllerUrl).build(); + return UrlConfig.builderFromConnectionConfig(scSastAndSscUrlConfig).url(controllerUrl).build(); } private static String getScSastUrl(IUrlConfig sscUrlConfig, char[] activeToken) {