Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Commit

Permalink
Let Ktor client chose it's own engine
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Apr 30, 2022
1 parent e1ae414 commit fc53671
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/kotlin/com/cyb3rko/m3okotlin/M3O.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.cyb3rko.m3okotlin

import io.ktor.client.*
import io.ktor.client.engine.apache.*
import io.ktor.client.features.*
import io.ktor.client.features.json.*
import io.ktor.client.features.json.serializer.*
Expand All @@ -25,7 +24,7 @@ object M3O {

authorization = "Authorization" to "Bearer $apiKey"

ktorHttpClient = HttpClient(Apache) {
ktorHttpClient = HttpClient {
followRedirects = true
expectSuccess = false

Expand Down Expand Up @@ -59,7 +58,7 @@ object M3O {

internal fun getKtorHttpMultipartClient(): HttpClient {
if (!::ktorHttpMultipartClient.isInitialized) {
ktorHttpMultipartClient = HttpClient(Apache) {
ktorHttpMultipartClient = HttpClient {
install(DefaultRequest) {
header(HttpHeaders.Authorization, authorization.second)
}
Expand Down

0 comments on commit fc53671

Please sign in to comment.