Fix reading release notes content length from appcast (#2921)

This commit is contained in:
Leo Camus authored and GitHub committed 2026-09-13 08:13:54 -07:00
1 parent 2be877fd1f
commit 7565a07922
4 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -843,7 +843,7 @@ static NSString *SPUSanitizeUntrustedVersionString(NSString *versionString, NSSt
#endif
];
long long releaseNotesLength = [(NSString *)[releaseNotesLinkDictionary objectForKey:@"length"] longLongValue];
long long releaseNotesLength = [(NSString *)[releaseNotesLinkDictionary objectForKey:SUAppcastAttributeLength] longLongValue];
_releaseNotesContentLength = (releaseNotesLength > 0) ? (uint64_t)releaseNotesLength : 0;
}
+1 -1
View File
@@ -5,7 +5,7 @@
<item>
<title>Version 3.0</title>
<pubDate>Sat, 26 Jul 2014 15:20:12 +0000</pubDate>
<sparkle:releaseNotesLink>https://sparkle-project.org/notes/relnote-3.0.txt</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink sparkle:length="1234">https://sparkle-project.org/notes/relnote-3.0.txt</sparkle:releaseNotesLink>
<sparkle:fullReleaseNotesLink>https://sparkle-project.org/fullnotes.txt</sparkle:fullReleaseNotesLink>
<link>https://sparkle-project.org</link>
<enclosure url="https://sparkle-project.org/release-3.0.zip" sparkle:version="3.0" length="1346234" />
+2
View File
@@ -1037,12 +1037,14 @@ class SUAppcastTest: XCTestCase {
// Test https
XCTAssertEqual("https://sparkle-project.org/notes/relnote-3.0.txt", items[0].releaseNotesURL?.absoluteString)
XCTAssertEqual(1234, items[0].releaseNotesContentLength)
XCTAssertEqual("https://sparkle-project.org/fullnotes.txt", items[0].fullReleaseNotesURL?.absoluteString)
XCTAssertEqual("https://sparkle-project.org", items[0].infoURL?.absoluteString)
XCTAssertEqual("https://sparkle-project.org/release-3.0.zip", items[0].fileURL?.absoluteString)
// Test http
XCTAssertEqual("http://sparkle-project.org/notes/relnote-2.0.txt", items[1].releaseNotesURL?.absoluteString)
XCTAssertEqual(0, items[1].releaseNotesContentLength)
XCTAssertEqual("http://sparkle-project.org/fullnotes.txt", items[1].fullReleaseNotesURL?.absoluteString)
XCTAssertEqual("http://sparkle-project.org", items[1].infoURL?.absoluteString)
XCTAssertEqual("http://sparkle-project.org/release-2.0.zip", items[1].fileURL?.absoluteString)
@@ -12,6 +12,7 @@
#import "SUAppcast.h"
#import "SUAppcast+Private.h"
#import "SUAppcastItem.h"
#import "SUAppcastItem+Private.h"
#import "SUAppcastDriver.h"
#import "SUVersionComparisonProtocol.h"
#import "SUStandardVersionComparator.h"