Hotfix for servers not accepting the Range header
Because of #2339, the file always exists when starting a download. There is still an issue with the server parsing "Range: bytes=0-" incorrectly, but this commit should make the error appear less often. Related to #2539
This commit is contained in:
parent
34a5d7eb17
commit
bc9d39dedf
|
@ -93,7 +93,7 @@ public class HttpDownloader extends Downloader {
|
||||||
|
|
||||||
|
|
||||||
// add range header if necessary
|
// add range header if necessary
|
||||||
if (fileExists) {
|
if (fileExists && destination.length() > 0) {
|
||||||
request.setSoFar(destination.length());
|
request.setSoFar(destination.length());
|
||||||
httpReq.addHeader("Range", "bytes=" + request.getSoFar() + "-");
|
httpReq.addHeader("Range", "bytes=" + request.getSoFar() + "-");
|
||||||
Log.d(TAG, "Adding range header: " + request.getSoFar());
|
Log.d(TAG, "Adding range header: " + request.getSoFar());
|
||||||
|
|
Loading…
Reference in New Issue