Stop using internal variable from okhttp3 (#17458)

This commit is contained in:
Noor Dawod
2023-12-22 12:07:08 +01:00
committed by GitHub
parent 5eab3cef19
commit a67e07e132
24 changed files with 71 additions and 23 deletions

View File

@@ -26,6 +26,7 @@ import java.time.OffsetTime
import java.util.Locale
import com.squareup.moshi.adapter
open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
@@ -198,6 +199,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie
val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US)
// TODO: handle specific mapping types. e.g. Map<int, Class<?>>
@Suppress("UNNECESSARY_SAFE_CALL")
return when {
response.isRedirect -> Redirection(
response.code(),