From 982d8193e75ef676f2d4624444325ad16acd7c1f Mon Sep 17 00:00:00 2001 From: Josh W Lewis Date: Tue, 15 Oct 2024 14:00:57 -0500 Subject: [PATCH 1/2] Use the MultiGzDecoder for better download reliability --- buildpacks/go/src/tgz.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpacks/go/src/tgz.rs b/buildpacks/go/src/tgz.rs index b20c1c7..370c562 100644 --- a/buildpacks/go/src/tgz.rs +++ b/buildpacks/go/src/tgz.rs @@ -1,4 +1,4 @@ -use flate2::read::GzDecoder; +use flate2::read::MultiGzDecoder; use sha2::{ digest::{generic_array::GenericArray, OutputSizeUser}, Digest, @@ -55,7 +55,7 @@ pub(crate) fn fetch_strip_filter_extract_verify<'a, D: Digest, V>( .map_err(Box::new)? .into_reader(); - let mut archive = Archive::new(GzDecoder::new(DigestingReader::new(body, D::new()))); + let mut archive = Archive::new(MultiGzDecoder::new(DigestingReader::new(body, D::new()))); let filters: Vec<&str> = filter_prefixes.into_iter().collect(); for entry in archive.entries().map_err(Error::Entries)? { let mut file = entry.map_err(Error::Entry)?; From 35a99453833cdab4786deef9ae18482318cc229c Mon Sep 17 00:00:00 2001 From: Josh W Lewis Date: Tue, 15 Oct 2024 16:00:04 -0500 Subject: [PATCH 2/2] Add changelog entry for MultiGzDecoder --- buildpacks/go/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpacks/go/CHANGELOG.md b/buildpacks/go/CHANGELOG.md index 2182294..b0c3383 100644 --- a/buildpacks/go/CHANGELOG.md +++ b/buildpacks/go/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Adjust Go distribution tarball download process for improved reliability. + ## [0.4.3] - 2024-08-13 - Added go1.23.0 (linux-amd64), go1.23.0 (linux-arm64).