fix: replace deprecated MediaType.parse() with toMediaType() extension
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.*
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import java.io.IOException
|
||||
|
||||
class AuthInterceptor(
|
||||
@@ -89,7 +90,7 @@ class AuthInterceptor(
|
||||
|
||||
val client = OkHttpClient()
|
||||
val body = okhttp3.RequestBody.create(
|
||||
okhttp3.MediaType.parse("application/json")!!,
|
||||
"application/json".toMediaType(),
|
||||
"""{"refresh_token":"$refreshToken"}"""
|
||||
)
|
||||
val refreshUrl = (cachedServerUrl ?: com.tiangong.aiagent.BuildConfig.BASE_URL).trimEnd('/') + "/api/v1/auth/refresh"
|
||||
|
||||
Reference in New Issue
Block a user