Upgrade OkHttp to 4.12.

Addresses #13491
This commit is contained in:
Nicholas Tinsley
2024-06-17 17:51:19 -04:00
committed by Greyson Parrelli
parent 9824cc2cbe
commit 8ba57a2733
11 changed files with 68 additions and 62 deletions

View File

@@ -53,10 +53,10 @@ object S3 {
fun getString(endpoint: String): String {
getObject(endpoint).use { response ->
if (!response.isSuccessful) {
throw NonSuccessfulResponseCodeException(response.code())
throw NonSuccessfulResponseCodeException(response.code)
}
return response.body()?.string()?.trim() ?: throw IOException()
return response.body?.string()?.trim() ?: throw IOException()
}
}
@@ -110,13 +110,13 @@ object S3 {
getObject(endpoint).use { response ->
if (!response.isSuccessful) {
return ServiceResponse.forApplicationError(
DefaultErrorMapper.getDefault().parseError(response.code()),
response.code(),
DefaultErrorMapper.getDefault().parseError(response.code),
response.code,
""
)
}
val source = response.body()?.source()
val source = response.body?.source()
val outputStream = ByteArrayOutputStream()
@@ -166,7 +166,7 @@ object S3 {
}
getObject(objectPathOnNetwork).use { response ->
val source = response.body()?.source()
val source = response.body?.source()
val outputStream: OutputStream = if (doNotEncrypt) {
FileOutputStream(objectFileOnDisk)