From 700a739f95fe2b4b8fff0be4150c779ad40dc136 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Thu, 27 May 2021 22:45:44 +0430 Subject: [PATCH] probably fixes http leaks (by @Syer10) --- .../suwayomi/tachidesk/impl/util/storage/CachedImageResponse.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/impl/util/storage/CachedImageResponse.kt b/server/src/main/kotlin/suwayomi/tachidesk/impl/util/storage/CachedImageResponse.kt index 87462fe..7ad8a76 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/impl/util/storage/CachedImageResponse.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/impl/util/storage/CachedImageResponse.kt @@ -8,6 +8,7 @@ package suwayomi.tachidesk.impl.util.storage * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import okhttp3.Response +import okhttp3.internal.closeQuietly import java.io.File import java.io.FileInputStream import java.io.InputStream @@ -55,6 +56,7 @@ object CachedImageResponse { return pathToInputStream(fullPath) to imageType } else { + response.closeQuietly() throw Exception("request error! ${response.code}") } }