diff --git a/src/eu/chainfire/opendelta/Download.java b/src/eu/chainfire/opendelta/Download.java index 1c469b1..854119b 100644 --- a/src/eu/chainfire/opendelta/Download.java +++ b/src/eu/chainfire/opendelta/Download.java @@ -308,9 +308,14 @@ public class Download { urlConnection.setRequestProperty("Range", "bytes=" + offset + "-"); urlConnection.connect(); int code = urlConnection.getResponseCode(); - if (code != HttpsURLConnection.HTTP_OK - && code != HttpsURLConnection.HTTP_PARTIAL) { - Logger.d("response: %d", code); + if (offset > 0 && code != HttpsURLConnection.HTTP_PARTIAL) { + Logger.d("response: %d expected: %d", code, + HttpsURLConnection.HTTP_PARTIAL); + return null; + } + if (offset == 0 && code != HttpsURLConnection.HTTP_OK) { + Logger.d("response: %d expected: %d", code, + HttpsURLConnection.HTTP_OK); return null; } return urlConnection;