diff --git a/CHANGELOG.md b/CHANGELOG.md index f585053..75ebec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.0.2 + +### 2025-12-22 + +- Fix processing of HTTP responses by removing unnecessary gzip header. + ## 1.0.1 ### 2025-08-01 diff --git a/pom.xml b/pom.xml index bfd31b4..9d46eb2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,5 +6,5 @@ 4.0.0 io.ionic.libs ionfiletransfer-android - 1.0.1 + 1.0.2 \ No newline at end of file diff --git a/src/main/kotlin/io/ionic/libs/ionfiletransferlib/IONFLTRController.kt b/src/main/kotlin/io/ionic/libs/ionfiletransferlib/IONFLTRController.kt index bd440f1..961ad72 100644 --- a/src/main/kotlin/io/ionic/libs/ionfiletransferlib/IONFLTRController.kt +++ b/src/main/kotlin/io/ionic/libs/ionfiletransferlib/IONFLTRController.kt @@ -9,7 +9,6 @@ import io.ionic.libs.ionfiletransferlib.helpers.assertSuccessHttpResponse import io.ionic.libs.ionfiletransferlib.helpers.runCatchingIONFLTRExceptions import io.ionic.libs.ionfiletransferlib.helpers.use import io.ionic.libs.ionfiletransferlib.model.IONFLTRDownloadOptions -import io.ionic.libs.ionfiletransferlib.model.IONFLTRException import io.ionic.libs.ionfiletransferlib.model.IONFLTRProgressStatus import io.ionic.libs.ionfiletransferlib.model.IONFLTRTransferComplete import io.ionic.libs.ionfiletransferlib.model.IONFLTRTransferResult @@ -186,9 +185,7 @@ class IONFLTRController internal constructor( BufferedOutputStream(fileOut).use { outputStream -> val buffer = ByteArray(BUFFER_SIZE) var bytesRead: Int - val lengthComputable = connection.contentEncoding.let { - it == null || it.equals("gzip", ignoreCase = true) - } && contentLength > 0 + val lengthComputable = contentLength > 0 var totalBytesRead: Long = 0 while (inputStream.read(buffer).also { bytesRead = it } != -1) { @@ -285,9 +282,6 @@ class IONFLTRController internal constructor( } } - // gzip to allow for better progress tracking - connection.setRequestProperty("Accept-Encoding", "gzip") - if (useChunkedMode) { connection.setChunkedStreamingMode(BUFFER_SIZE) connection.setRequestProperty("Transfer-Encoding", "chunked")