From 61bb5bc2ae49a65ba2f8e9199b5b566c3b67982d Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Tue, 26 Nov 2024 09:44:40 -0800 Subject: [PATCH] fmt --- .../capture/network/okhttp/OkHttpNetwork.kt | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/network/okhttp/OkHttpNetwork.kt b/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/network/okhttp/OkHttpNetwork.kt index 4f26f8ff..c9aaeafa 100644 --- a/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/network/okhttp/OkHttpNetwork.kt +++ b/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/network/okhttp/OkHttpNetwork.kt @@ -80,27 +80,27 @@ internal class OkHttpNetwork( timeoutSeconds: Long = 2L * 60, ) : ICaptureNetwork { private val client: OkHttpClient = - run { - val builder = OkHttpClient().newBuilder() - // Certain other libraries will manipulate the bytecode to have the OkHttpClientBuilder - // constructor automatically add interceptors which tend to not work well with our bespoke - // client implementation. Remove these extra interceptors here to ensure that we are using - // a standard client. - builder.interceptors().clear() - builder.networkInterceptors().clear() - builder - .protocols( - if (apiBaseUrl.scheme == "https") { - listOf(Protocol.HTTP_2, Protocol.HTTP_1_1) - } else { - listOf(Protocol.H2_PRIOR_KNOWLEDGE) - }, - ) - .writeTimeout(timeoutSeconds, TimeUnit.SECONDS) - .readTimeout(timeoutSeconds, TimeUnit.SECONDS) - .retryOnConnectionFailure(false) // Retrying messes up the write pipe state management, so disable. - .build() - } + run { + val builder = OkHttpClient().newBuilder() + // Certain other libraries will manipulate the bytecode to have the OkHttpClientBuilder + // constructor automatically add interceptors which tend to not work well with our bespoke + // client implementation. Remove these extra interceptors here to ensure that we are using + // a standard client. + builder.interceptors().clear() + builder.networkInterceptors().clear() + builder + .protocols( + if (apiBaseUrl.scheme == "https") { + listOf(Protocol.HTTP_2, Protocol.HTTP_1_1) + } else { + listOf(Protocol.H2_PRIOR_KNOWLEDGE) + }, + ) + .writeTimeout(timeoutSeconds, TimeUnit.SECONDS) + .readTimeout(timeoutSeconds, TimeUnit.SECONDS) + .retryOnConnectionFailure(false) // Retrying messes up the write pipe state management, so disable. + .build() + } private val executor: ExecutorService = Executors.newSingleThreadExecutor { Thread(it, "io.bitdrift.capture.network.okhttp")