Bug 1839067 - Ensure response's body closed whether request is success or not.

fenix/124.1.0
jackyzy823 12 months ago committed by mergify[bot]
parent 15aeb19be2
commit e1f03ba3c9

@ -28,7 +28,7 @@ object SearchStringValidator {
}
// read the response stream to ensure the body is closed correctly. workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1603114
response.body.close()
response.close()
return if (response.isSuccess ||
isTestQueryParamNotFound(response.status)
) {

@ -79,6 +79,7 @@ class WallpaperDownloader(
return@withContext Result.runCatching {
val response = client.fetch(request)
if (!response.isSuccess) {
response.close()
throw IllegalStateException()
}
localFile.parentFile?.mkdirs()

Loading…
Cancel
Save