Merge pull request #381 from Hy4ri/dependabot/gradle/okhttp-5.4.0

chore: bump okhttp from 4.12.0 to 5.4.0
This commit is contained in:
M57 authored and GitHub committed 2026-06-26 00:02:16 +03:00
commit 07ec453a4b
4 files changed
+9 -8

No files matched your search

@@ -25,7 +25,7 @@ import kotlinx.coroutines.launch
import okhttp3.CertificatePinner import okhttp3.CertificatePinner
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response import okhttp3.Response
import okhttp3.WebSocket import okhttp3.WebSocket
import okhttp3.WebSocketListener import okhttp3.WebSocketListener
@@ -166,7 +166,7 @@ object HermesWsClient {
Request.Builder() Request.Builder()
.url("http://${AuthManager.getHost()}:${AuthManager.getPort()}/api/auth/ws-ticket") .url("http://${AuthManager.getHost()}:${AuthManager.getPort()}/api/auth/ws-ticket")
.header("Cookie", "hermes_session_at=$sessionCookie") .header("Cookie", "hermes_session_at=$sessionCookie")
.post(RequestBody.create(null, "{}")) .post("{}".toRequestBody())
.build() .build()
val response = client.newCall(request).execute() val response = client.newCall(request).execute()
if (response.isSuccessful) { if (response.isSuccessful) {
@@ -18,7 +18,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
/** /**
@@ -341,7 +341,7 @@ class AuthLoginViewModel(private val app: Application) : ViewModel() {
Request.Builder() Request.Builder()
.url("$baseUrl/auth/password-login") .url("$baseUrl/auth/password-login")
.header("Content-Type", "application/json") .header("Content-Type", "application/json")
.post(RequestBody.create(null, jsonBody)) .post(jsonBody.toRequestBody())
.build() .build()
val loginResp = loginClient.newCall(loginReq).execute() val loginResp = loginClient.newCall(loginReq).execute()
@@ -389,7 +389,7 @@ class AuthLoginViewModel(private val app: Application) : ViewModel() {
Request.Builder() Request.Builder()
.url("$baseUrl/api/auth/ws-ticket") .url("$baseUrl/api/auth/ws-ticket")
.header("Cookie", cookieHeader) .header("Cookie", cookieHeader)
.post(RequestBody.create(null, "{}")) .post("{}".toRequestBody())
.build() .build()
val ticketResp = ticketClient.newCall(ticketReq).execute() val ticketResp = ticketClient.newCall(ticketReq).execute()
@@ -60,10 +60,11 @@ class HermesWsClientTest {
fun tearDown() { fun tearDown() {
HermesWsClient.disconnect() HermesWsClient.disconnect()
// Wait a bit to allow internal OkHttp coroutines to clean up before shutting down MockWebServer // Wait a bit to allow internal OkHttp coroutines to clean up before shutting down MockWebServer
Thread.sleep(100) // Increased from 100ms for OkHttp 5.x — needs more time for the WS close handshake
Thread.sleep(500)
try { try {
mockWebServer.shutdown() mockWebServer.shutdown()
} catch (e: Exception) { } catch (e: Throwable) {
e.printStackTrace() e.printStackTrace()
} }
unmockkAll() unmockkAll()
+1 -1
View File
@@ -19,7 +19,7 @@ ksp = "2.3.9"
nav3Core = "1.0.1" nav3Core = "1.0.1"
lifecycleViewmodelNav3 = "2.10.0" lifecycleViewmodelNav3 = "2.10.0"
leakcanary = "2.14" leakcanary = "2.14"
okhttp = "4.12.0" okhttp = "5.4.0"
retrofit = "2.11.0" retrofit = "2.11.0"
gson = "2.14.0" gson = "2.14.0"
securityCrypto = "1.0.0" securityCrypto = "1.0.0"