Skip to content

Commit fc94f4a

Browse files
committed
Strip url of extra details when pinging
1 parent 9b1a946 commit fc94f4a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ui-app/src/main/kotlin/dev/clombardo/dnsnet/ui/app/viewmodel/HomeViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,9 @@ class HomeViewModel @Inject constructor(
423423

424424
fun pingAddress(address: String): Boolean =
425425
try {
426-
InetAddress.getByName(address).isReachable(3_000)
426+
InetAddress.getByName(
427+
address.substringBeforeLast("/").substringAfterLast("/")
428+
).isReachable(3_000)
427429
} catch (_: UnknownHostException) {
428430
false
429431
}

0 commit comments

Comments
 (0)