From 26243b664e75ee957311d7265054f9027dedb7b4 Mon Sep 17 00:00:00 2001 From: Omar Aljarrah <50204418+OmarAlJarrah@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:59:25 +0300 Subject: [PATCH] fix: inconsistent custom okhttp configuration (#901) PR: https://github.com/ExpediaGroup/expediagroup-java-sdk/pull/901 --- .../com/expediagroup/sdk/core/client/BaseRapidClient.kt | 5 ++++- .../kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt b/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt index 52d20daa3..9dee8b404 100644 --- a/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt +++ b/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt @@ -43,7 +43,10 @@ abstract class BaseRapidClient( private val engine: HttpClientEngine = _configurationProvider.okHttpClient?.let { OkHttp.create { - preconfigured = it + config { + preconfigured = it + dispatcher(it.dispatcher) + } } } ?: httpClientEngine diff --git a/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt b/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt index 19ef01d16..fb87dc254 100644 --- a/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt +++ b/core/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt @@ -43,7 +43,10 @@ abstract class BaseXapClient( private val engine: HttpClientEngine = _configurationProvider.okHttpClient?.let { OkHttp.create { - preconfigured = it + config { + preconfigured = it + dispatcher(it.dispatcher) + } } } ?: httpClientEngine