--- SessionDelegate.swift.orig 2022-03-12 17:34:07.000000000 -0300 +++ SessionDelegate.swift 2022-03-16 15:51:22.000000000 -0300 @@ -292,6 +292,16 @@ return } + let allHeaders = (downloadRequest.response)?.allHeaderFields as? NSDictionary ?? NSDictionary() + let sizeString = (allHeaders["X-Uncompressed-Content-Length"] ?? allHeaders["x-uncompressed-content-length"]) as? String + if (sizeString != nil) { + let size = Int64(sizeString!) + downloadRequest.updateDownloadProgress(bytesWritten: bytesWritten, + totalBytesExpectedToWrite: size!) + return + + } + downloadRequest.updateDownloadProgress(bytesWritten: bytesWritten, totalBytesExpectedToWrite: totalBytesExpectedToWrite) }