File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/commonMain/kotlin/com.adamratzman.spotify/http Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public class HttpConnection constructor(
9191 val httpRequest = buildRequest(additionalHeaders)
9292 if (api?.spotifyApiOptions?.enableDebugMode == true ) println (" DEBUG MODE: Request: $this " )
9393 try {
94- return HttpClient () .request< io.ktor.client.statement.HttpResponse > (httpRequest).let { response ->
94+ return httpClient .request< io.ktor.client.statement.HttpResponse > (httpRequest).let { response ->
9595 val respCode = response.status.value
9696
9797 if (respCode in 500 .. 599 && (retryIfInternalServerErrorLeft == null || retryIfInternalServerErrorLeft == - 1 || retryIfInternalServerErrorLeft > 0 )) {
@@ -216,6 +216,12 @@ public class HttpConnection constructor(
216216 |headers=${headers.toList()}
217217 | )""" .trimMargin()
218218 }
219+
220+ internal companion object {
221+ internal val httpClient = HttpClient {
222+ expectSuccess = false
223+ }
224+ }
219225}
220226
221227public enum class HttpConnectionStatus (public val code : Int ) {
You can’t perform that action at this time.
0 commit comments