validateUriResolving

suspend fun validateUriResolving(uri: String, allowPrivateAddresses: Boolean = false)

Resolves uri and validates every address it points at.

Suspending, and resolution runs on Dispatchers.IO, because name lookup on the main thread throws NetworkOnMainThreadException. The previous implementation resolved inline from a main-thread dispatcher, caught that exception, and returned — so on a real device no hostname was ever validated. Only IP literals, which need no lookup, were being checked.

The result is cached so validateResolved can answer synchronously from the redirect callback, which cannot suspend.