Skip to content

Commit 556f143

Browse files
committed
updated httpurlconnection downloader
Updated httpurlconnection downloader isResponseOk method.
1 parent 0d6167e commit 556f143

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fetch2/src/main/java/com/tonyodev/fetch2/HttpUrlConnectionDownloader.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ open class HttpUrlConnectionDownloader @JvmOverloads constructor(
6161
}
6262

6363
fun isResponseOk(responseCode: Int): Boolean {
64-
return when (responseCode) {
65-
HttpURLConnection.HTTP_OK,
66-
HttpURLConnection.HTTP_PARTIAL,
67-
HttpURLConnection.HTTP_ACCEPTED -> true
68-
else -> false
69-
}
64+
return responseCode in 200..299
7065
}
7166

7267
override fun disconnect(response: Downloader.Response) {

0 commit comments

Comments
 (0)