mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-28 05:39:07 +00:00
Statement unnecessarily nested within else clause.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1789170 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1f8cd58f6
commit
192acfde4d
@ -282,14 +282,13 @@ static String extractCN(final String subjectPrincipal) throws SSLException {
|
||||
static HostNameType determineHostFormat(final String host) {
|
||||
if (InetAddressUtils.isIPv4Address(host)) {
|
||||
return HostNameType.IPv4;
|
||||
} else {
|
||||
String s = host;
|
||||
if (s.startsWith("[") && s.endsWith("]")) {
|
||||
s = host.substring(1, host.length() - 1);
|
||||
}
|
||||
if (InetAddressUtils.isIPv6Address(s)) {
|
||||
return HostNameType.IPv6;
|
||||
}
|
||||
}
|
||||
String s = host;
|
||||
if (s.startsWith("[") && s.endsWith("]")) {
|
||||
s = host.substring(1, host.length() - 1);
|
||||
}
|
||||
if (InetAddressUtils.isIPv6Address(s)) {
|
||||
return HostNameType.IPv6;
|
||||
}
|
||||
return HostNameType.DNS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user