aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/tar.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-05 00:43:21 +0900
committerOphestra <cat@gensokyo.uk>2026-01-05 00:43:21 +0900
commit4da26681b58fb3afa9c2a297f159e6b325910e2d (patch)
treed107fd7a63d4c94ad0dd499214bf07eab2d6e31f /internal/pkg/tar.go
parent4897b0259edeb256a3d5cf77148758536e366e64 (diff)
internal/pkg: compute http identifier from url
The previous implementation exposes arbitrary user input to the cache as an identifier, which is highly error-prone and can cause the cache to enter an inconsistent state if the user is not careful. This change replaces the implementation to compute identifier late, using url string as params. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/tar.go')
-rw-r--r--internal/pkg/tar.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/pkg/tar.go b/internal/pkg/tar.go
index 2b9aacdf..24411c50 100644
--- a/internal/pkg/tar.go
+++ b/internal/pkg/tar.go
@@ -43,12 +43,8 @@ func NewHTTPGetTar(
url string,
checksum Checksum,
compression uint64,
-) (Artifact, error) {
- f, err := NewHTTPGet(ctx, hc, url, checksum)
- if err != nil {
- return nil, err
- }
- return NewTar(f, compression), nil
+) Artifact {
+ return NewTar(NewHTTPGet(ctx, hc, url, checksum), compression)
}
// Kind returns the hardcoded [Kind] constant.