@@ -15,7 +15,9 @@ public static ProxyConfiguration getHttpProxyValueOrNull(String httpProxyValue)
1515 return null ;
1616 }
1717
18- boolean isHttpOrHttps = httpProxyValue .startsWith ("http://" ) || httpProxyValue .startsWith ("https://" );
18+ final boolean isHttp = httpProxyValue .startsWith ("http://" );
19+ final boolean isHttps = httpProxyValue .startsWith ("https://" );
20+ final boolean isHttpOrHttps = isHttp || isHttps ;
1921 if (isHttpOrHttps )
2022 {
2123 httpProxyValue = httpProxyValue
@@ -28,7 +30,7 @@ public static ProxyConfiguration getHttpProxyValueOrNull(String httpProxyValue)
2830
2931 String addressUrl ;
3032 String authenticationString = "" ;
31- boolean hasAuthentication = httpProxyValue .contains ("@" );
33+ final boolean hasAuthentication = httpProxyValue .contains ("@" );
3234 if (hasAuthentication )
3335 {
3436 String [] authenticationAndAddress = httpProxyValue .split ("@" );
@@ -40,8 +42,8 @@ public static ProxyConfiguration getHttpProxyValueOrNull(String httpProxyValue)
4042 }
4143
4244 String host ;
43- int port = 80 ;
44- boolean hasHostnameAndPort = addressUrl .contains (":" );
45+ int port = isHttp ? 80 : 443 ;
46+ final boolean hasHostnameAndPort = addressUrl .contains (":" );
4547 if (hasHostnameAndPort )
4648 {
4749 String [] hostAndPortParts = addressUrl .split (":" );
@@ -54,7 +56,7 @@ public static ProxyConfiguration getHttpProxyValueOrNull(String httpProxyValue)
5456
5557 String username = null ;
5658 String password = null ;
57- boolean hasUsernameAndPassword = authenticationString .contains (":" );
59+ final boolean hasUsernameAndPassword = authenticationString .contains (":" );
5860 if (hasUsernameAndPassword )
5961 {
6062 String [] usernameAndPassword = authenticationString .split (":" );
0 commit comments