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(
91
91
val httpRequest = buildRequest(additionalHeaders)
92
92
if (api?.spotifyApiOptions?.enableDebugMode == true ) println (" DEBUG MODE: Request: $this " )
93
93
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 ->
95
95
val respCode = response.status.value
96
96
97
97
if (respCode in 500 .. 599 && (retryIfInternalServerErrorLeft == null || retryIfInternalServerErrorLeft == - 1 || retryIfInternalServerErrorLeft > 0 )) {
@@ -216,6 +216,12 @@ public class HttpConnection constructor(
216
216
|headers=${headers.toList()}
217
217
| )""" .trimMargin()
218
218
}
219
+
220
+ internal companion object {
221
+ internal val httpClient = HttpClient {
222
+ expectSuccess = false
223
+ }
224
+ }
219
225
}
220
226
221
227
public enum class HttpConnectionStatus (public val code : Int ) {
You can’t perform that action at this time.
0 commit comments