Skip to content

Commit

Permalink
Check port is the same if builder has port
Browse files Browse the repository at this point in the history
  • Loading branch information
yejinio committed Jan 30, 2024
1 parent 3adf832 commit 90a50c6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,10 @@ boolean equalsHostnamePattern(String hostnamePattern) {
checkArgument(!hostnamePattern.isEmpty(), "hostnamePattern is empty.");

final HostAndPort hostAndPort = HostAndPort.fromString(hostnamePattern);
if (hostAndPort.hasPort()) {
if (port == -1 ^ !hostAndPort.hasPort()) {
return false;
}
if (port != -1) {
if (port != hostAndPort.getPort()) {
return false;
}
Expand Down

0 comments on commit 90a50c6

Please sign in to comment.