diff options
author | Yuri Nesterenko <yan@openjdk.org> | 2024-01-30 19:48:35 +0400 |
---|---|---|
committer | Christoph Langer <clanger@openjdk.org> | 2024-03-26 22:44:18 +0100 |
commit | 8eba98ad61905be909b673144b68c6259346665f (patch) | |
tree | 61161598d887b06461484ee14e5267fbba309ddf | |
parent | 07fc624683c58b708486fb1dc8afa0c2cd85ce11 (diff) | |
download | libcore-8eba98ad61905be909b673144b68c6259346665f.tar.gz |
8315708: Enhance HTTP/2 client usage
Reviewed-by: mbalao
Backport-of: 4bd9637dfe12d330afd7409c27c5778b28a24cf4
-rw-r--r-- | src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java index e03dc34e900..265accdbc37 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java @@ -104,14 +104,10 @@ final class ConnectionPool { return false; } if (secure && destination != null) { - if (destination.getHostName() != null) { - if (!destination.getHostName().equalsIgnoreCase( - other.destination.getHostName())) { - return false; - } - } else { - if (other.destination.getHostName() != null) - return false; + String hostString = destination.getHostString(); + if (hostString == null || !hostString.equalsIgnoreCase( + other.destination.getHostString())) { + return false; } } return true; |