diff --git a/core/src/commonMain/kotlin/builder/kord/KordBuilderUtil.kt b/core/src/commonMain/kotlin/builder/kord/KordBuilderUtil.kt index a4640a05e82..d7ac3c65cf9 100644 --- a/core/src/commonMain/kotlin/builder/kord/KordBuilderUtil.kt +++ b/core/src/commonMain/kotlin/builder/kord/KordBuilderUtil.kt @@ -13,8 +13,15 @@ import kotlinx.serialization.json.Json internal fun HttpClientConfig<*>.defaultConfig() { expectSuccess = false + val json = Json { + encodeDefaults = false + allowStructuredMapKeys = true + ignoreUnknownKeys = true + isLenient = true + } + install(ContentNegotiation) { - json() + json(json) } install(WebSockets) } @@ -26,18 +33,8 @@ public fun HttpClient?.configure(): HttpClient { defaultConfig() } - val json = Json { - encodeDefaults = false - allowStructuredMapKeys = true - ignoreUnknownKeys = true - isLenient = true - } - return HttpClient(httpEngine()) { defaultConfig() - install(ContentNegotiation) { - json(json) - } } }