Christian Würthenr
09/18/2024, 6:55 AMintercept
of HttpSend
Aleksei Tirman [JB]
09/18/2024, 8:56 AMChristian Würthenr
09/18/2024, 8:57 AMChristian Würthenr
09/19/2024, 6:40 AMinstall("OctoRemoteIp") {
receivePipeline.intercept(HttpReceivePipeline.State) { response ->
withTimeoutOrNull(1.seconds) {
val host = response.request.url.host
dataDelegate.remoteAddressCache.first { it.containsKey(host) }[host]
}?.let { remoteIp ->
response.call.attributes.put(OctoRemoteIpAttributeKey, remoteIp)
}
proceedWith(response)
}
}