From 7c41198f44458c6024cd475f765b398ab5517c64 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 13 Sep 2026 15:44:35 -0700 Subject: [PATCH] Fix unused appcast length fallback if server reports no content size (#2922) Potentially this could result in an indeterminate progress bar even though the appcast specifies the length of the download. --- Downloader/SPUDownloader.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Downloader/SPUDownloader.m b/Downloader/SPUDownloader.m index 1160b4b2..fccc8511 100644 --- a/Downloader/SPUDownloader.m +++ b/Downloader/SPUDownloader.m @@ -312,9 +312,9 @@ static bool SPUValidateStatusCodeAndFailIfInvalid(NSURLResponse * _Nullable resp return; } - if (totalBytesExpectedToWrite > 0 && !_receivedExpectedBytes) { + if (!_receivedExpectedBytes) { _receivedExpectedBytes = YES; - [_delegate downloaderDidReceiveExpectedContentLength:totalBytesExpectedToWrite]; + [_delegate downloaderDidReceiveExpectedContentLength:(totalBytesExpectedToWrite != NSURLSessionTransferSizeUnknown) ? totalBytesExpectedToWrite : 0]; } if (bytesWritten >= 0) {