mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix: third-party GitHub mirrors only serve downloads with a trusted digest (#1057)
fix: a third-party GitHub mirror can only serve downloads that carry a trusted digest Downloads without an expected SHA-256 were still sent through gh-proxy, ghfast and other mirrors, and the first answer was accepted, so a mirror could swap an AppImage or a Windows component. Downloader.downloadFile now tries only the original URL when there is no digest. UserApps passes GitHub's own asset digest, and WinComponents passes the snapshot's archive digest, so those large files keep their mirror fallback. Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com> Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
This commit is contained in:
1 parent
d9328c39df
commit
87e4b42ed8
4 files changed
+23
-6
No files matched your search
@@ -167,4 +167,10 @@ class DownloaderResumeTest {
|
||||
assertEquals(listOf(catalog), DownloadSource.candidates(catalog))
|
||||
}
|
||||
|
||||
|
||||
@Test fun withoutADigestOnlyTheOriginalUrlIsTried() {
|
||||
val url = "https://github.com/owner/repo/releases/download/v1/app.AppImage"
|
||||
assertEquals(listOf(url), Downloader.sources(url, null))
|
||||
assertEquals(DownloadSource.candidates(url), Downloader.sources(url, "a".repeat(64)))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user