Skip to content

Commit bdad865

Browse files
committed
polishing
1 parent 0f39dec commit bdad865

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

client/src/main/java/io/split/client/SplitFactoryImpl.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ private static HttpClientBuilder setupProxy(HttpClientBuilder httpClientbuilder,
632632
if (config.proxyConfiguration() != null && config.proxyConfiguration().getHost() != null) {
633633
proxyHost = config.proxyConfiguration().getHost();
634634
} else {
635+
_log.warn("`proxyHost`, `proxyPort` configuration methods are deprecated. Please use `ProxyConfiguration` builder instead.");
635636
proxyHost = config.proxy();
636637
}
637638
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxyHost);
@@ -643,14 +644,16 @@ private static HttpClientBuilder setupProxy(HttpClientBuilder httpClientbuilder,
643644
_log.debug("Proxy setup using credentials");
644645
String userName;
645646
String password;
646-
if (config.proxyUsername() != null && config.proxyPassword() != null) {
647-
userName = config.proxyUsername();
648-
password = config.proxyPassword();
649-
} else {
647+
if (config.proxyUsername() == null && config.proxyPassword() == null) {
650648
io.split.client.dtos.BasicCredentialsProvider basicAuth =
651649
(io.split.client.dtos.BasicCredentialsProvider) config.proxyConfiguration().getProxyCredentialsProvider();
652650
userName = basicAuth.getUsername();
653651
password = basicAuth.getPassword();
652+
} else {
653+
_log.warn("`proxyUsername` and `proxyPassword` configuration methods are deprecated. " +
654+
"Please use `ProxyConfiguration` builder instead.");
655+
userName = config.proxyUsername();
656+
password = config.proxyPassword();
654657
}
655658
BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
656659
AuthScope siteScope = new AuthScope(proxyHost.getHostName(), proxyHost.getPort());

0 commit comments

Comments
 (0)