Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3c60d84

Browse files
committedMar 20, 2024
Allow using existing http client
1 parent dad161f commit 3c60d84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/main/kotlin/com/coder/gateway/sdk/BaseCoderRestClient.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ open class BaseCoderRestClient(
5050
private val settings: CoderSettings = CoderSettings(CoderSettingsState()),
5151
private val proxyValues: ProxyValues? = null,
5252
private val pluginVersion: String = "development",
53+
existingHttpClient: OkHttpClient? = null,
5354
) {
5455
private val httpClient: OkHttpClient
5556
private val retroRestClient: CoderV2RestFacade
@@ -67,7 +68,7 @@ open class BaseCoderRestClient(
6768

6869
val socketFactory = coderSocketFactory(settings.tls)
6970
val trustManagers = coderTrustManagers(settings.tls.caPath)
70-
var builder = OkHttpClient.Builder()
71+
var builder = existingHttpClient?.newBuilder() ?: OkHttpClient.Builder()
7172

7273
if (proxyValues != null) {
7374
builder = builder

0 commit comments

Comments
 (0)
Please sign in to comment.