Skip to content

Commit

Permalink
fix: cannot get content length during download connections
Browse files Browse the repository at this point in the history
should get content length from Content-Range if there is no Content-Length in the response during download connections

close #967
  • Loading branch information
Tianhua Ran committed Mar 11, 2018
1 parent 0795595 commit 2a5b81a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ public static long findInstanceLengthFromContentRange(FileDownloadConnection con
public static long findContentLength(final int id, FileDownloadConnection connection) {
long contentLength = FileDownloadUtils
.convertContentLengthString(connection.getResponseHeaderField("Content-Length"));
if (contentLength < 0) contentLength = findInstanceLengthFromContentRange(connection);
final String transferEncoding = connection.getResponseHeaderField("Transfer-Encoding");

if (contentLength < 0) {
Expand Down

0 comments on commit 2a5b81a

Please sign in to comment.