OpenDelta: Download: Match HTTP response with expectation
This commit is contained in:
parent
10a91b3321
commit
c3829a8d79
|
@ -308,9 +308,14 @@ public class Download {
|
||||||
urlConnection.setRequestProperty("Range", "bytes=" + offset + "-");
|
urlConnection.setRequestProperty("Range", "bytes=" + offset + "-");
|
||||||
urlConnection.connect();
|
urlConnection.connect();
|
||||||
int code = urlConnection.getResponseCode();
|
int code = urlConnection.getResponseCode();
|
||||||
if (code != HttpsURLConnection.HTTP_OK
|
if (offset > 0 && code != HttpsURLConnection.HTTP_PARTIAL) {
|
||||||
&& code != HttpsURLConnection.HTTP_PARTIAL) {
|
Logger.d("response: %d expected: %d", code,
|
||||||
Logger.d("response: %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 null;
|
||||||
}
|
}
|
||||||
return urlConnection;
|
return urlConnection;
|
||||||
|
|
Loading…
Reference in New Issue