André Martins
02/22/2022, 10:51 AMAleksei Tirman [JB]
02/22/2022, 2:21 PMAndré Martins
02/22/2022, 3:19 PMAleksei Tirman [JB]
02/22/2022, 4:59 PMAndré Martins
02/22/2022, 5:11 PMoverride fun install(feature: DnsResolverFeature, scope: HttpClient) {
scope.sendPipeline.insertPhaseBefore(HttpSendPipeline.Engine, DNSResolve)
scope.sendPipeline.intercept(DNSResolve) {
val host = context.host
repeat(retries) {
try {
val addr = withTimeout(timeout) {
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
InetAddress.getByName(host)
}
}
context.host = addr.hostAddress
return@repeat
} catch (ex: TimeoutCancellationException) {
<http://logger.info|logger.info>("Timeout occurred while resolving the IP address for host: $host")
throw UnknownHostException(host)
}
}
}
}
Aleksei Tirman [JB]
02/22/2022, 5:16 PMHost
header in a request will contain an original hostname or an IP-address?André Martins
02/22/2022, 5:22 PMAleksei Tirman [JB]
02/23/2022, 7:59 AMAndré Martins
02/23/2022, 9:49 AM