Skip to content

Commit c0004f2

Browse files
fix: Removed explicit setting of HttpURLConnection Accept-Encoding header value as it disables automatic response decompression (#10)
* Removed explicit setting of `HttpURLConnection` `Accept-Encoding` header value as it disables automatic response decompression * chore: Removed unnecessary check for gzip in download * chore(release): Prepare for version 1.0.2 --------- Co-authored-by: OS-pedrogustavobilro <[email protected]>
1 parent 48ec705 commit c0004f2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 1.0.2
8+
9+
### 2025-12-22
10+
11+
- Fix processing of HTTP responses by removing unnecessary gzip header.
12+
713
## 1.0.1
814

915
### 2025-08-01

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>io.ionic.libs</groupId>
88
<artifactId>ionfiletransfer-android</artifactId>
9-
<version>1.0.1</version>
9+
<version>1.0.2</version>
1010
</project>

src/main/kotlin/io/ionic/libs/ionfiletransferlib/IONFLTRController.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import io.ionic.libs.ionfiletransferlib.helpers.assertSuccessHttpResponse
99
import io.ionic.libs.ionfiletransferlib.helpers.runCatchingIONFLTRExceptions
1010
import io.ionic.libs.ionfiletransferlib.helpers.use
1111
import io.ionic.libs.ionfiletransferlib.model.IONFLTRDownloadOptions
12-
import io.ionic.libs.ionfiletransferlib.model.IONFLTRException
1312
import io.ionic.libs.ionfiletransferlib.model.IONFLTRProgressStatus
1413
import io.ionic.libs.ionfiletransferlib.model.IONFLTRTransferComplete
1514
import io.ionic.libs.ionfiletransferlib.model.IONFLTRTransferResult
@@ -186,9 +185,7 @@ class IONFLTRController internal constructor(
186185
BufferedOutputStream(fileOut).use { outputStream ->
187186
val buffer = ByteArray(BUFFER_SIZE)
188187
var bytesRead: Int
189-
val lengthComputable = connection.contentEncoding.let {
190-
it == null || it.equals("gzip", ignoreCase = true)
191-
} && contentLength > 0
188+
val lengthComputable = contentLength > 0
192189
var totalBytesRead: Long = 0
193190

194191
while (inputStream.read(buffer).also { bytesRead = it } != -1) {
@@ -285,9 +282,6 @@ class IONFLTRController internal constructor(
285282
}
286283
}
287284

288-
// gzip to allow for better progress tracking
289-
connection.setRequestProperty("Accept-Encoding", "gzip")
290-
291285
if (useChunkedMode) {
292286
connection.setChunkedStreamingMode(BUFFER_SIZE)
293287
connection.setRequestProperty("Transfer-Encoding", "chunked")

0 commit comments

Comments
 (0)