From 72761797a25ced34a73c171d64d15378f8219914 Mon Sep 17 00:00:00 2001 From: jingyuexing <19589872+jingyuexing@users.noreply.github.com> Date: Mon, 11 Aug 2025 03:40:14 +0800 Subject: [PATCH] Fix SHA-256 verification mismatch when downloading language servers (#35953) Closes #35642 Release Notes: - Fixed: when the expected digest included a "sha256:" prefix while the computed digest has no prefix. --- crates/languages/src/github_download.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/languages/src/github_download.rs b/crates/languages/src/github_download.rs index a3cd0a964b31c17e73a72317efc0616474dc846d..04f5ecfa08f3fa3a50965388c5cf94be05d7493d 100644 --- a/crates/languages/src/github_download.rs +++ b/crates/languages/src/github_download.rs @@ -62,6 +62,12 @@ pub(crate) async fn download_server_binary( format!("saving archive contents into the temporary file for {url}",) })?; let asset_sha_256 = format!("{:x}", writer.hasher.finalize()); + + // Strip "sha256:" prefix for comparison + let expected_sha_256 = expected_sha_256 + .strip_prefix("sha256:") + .unwrap_or(expected_sha_256); + anyhow::ensure!( asset_sha_256 == expected_sha_256, "{url} asset got SHA-256 mismatch. Expected: {expected_sha_256}, Got: {asset_sha_256}",