Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ public void downloadPackage(JSONObject updatePackage, String expectedBundleFileN
progressCallback.call(new DownloadProgress(totalBytes, receivedBytes));
}

if (totalBytes != receivedBytes) {
// getContentLength() returns -1 when the response has no Content-Length (e.g. a proxy
// re-chunked it), so only compare when the length is known. A truncated chunked
// response still fails with an IOException in the read loop above.
if (totalBytes >= 0 && totalBytes != receivedBytes) {
Comment thread
ofalvai marked this conversation as resolved.
Resolved
throw new CodePushUnknownException("Received " + receivedBytes + " bytes, expected " + totalBytes);
}

Expand Down
Loading