Skip to content

Commit

Permalink
fix: ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
Suqatri committed Apr 6, 2024
1 parent 7ad3650 commit bb5169e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ abstract class CloudService(
}

override fun startSession(ipAddress: String): ServiceSession {
var parsedHostname = ipAddress
if (isIpv6(ipAddress) && !ipAddress.startsWith("[")) {
parsedHostname = "[$ipAddress]"
}
if (!isIpv4(ipAddress) && !isIpv6(ipAddress)) {
throw IllegalArgumentException("Invalid IP address: $ipAddress")
}
val session = ServiceSession(this.serviceId, System.currentTimeMillis(), ipAddress)
var hostname = ipAddress
if (isIpv6(ipAddress) && !ipAddress.startsWith("[")) {
hostname = "[$ipAddress]"
}
val session = ServiceSession(this.serviceId, System.currentTimeMillis(), hostname)
sessions.currentSession = session
if (registrationSession == null) {
sessions.registrationSession = session
Expand Down

0 comments on commit bb5169e

Please sign in to comment.