Skip to content

Commit 893cf5b

Browse files
authored
fix(external): use URLEncoding to decode blob URL (#1047)
Because - base64.StdEncoding might generate `/` in the Base64 string, which can break the structure of the generated blob URL. This commit: - Uses base64.URLEncoding to decode the blob URL.
1 parent df241f5 commit 893cf5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/external/external.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (f *artifactBinaryFetcher) FetchFromURL(ctx context.Context, fileURL string
300300
// The presigned URL is encoded in the format:
301301
// scheme://host/v1alpha/blob-urls/base64_encoded_presigned_url
302302
// Here we decode the base64 string to the presigned URL.
303-
base64Decoded, err := base64.StdEncoding.DecodeString(strings.Split(parsedURL.Path, "/")[3])
303+
base64Decoded, err := base64.URLEncoding.DecodeString(strings.Split(parsedURL.Path, "/")[3])
304304
if err != nil {
305305
return nil, "", "", err
306306
}

0 commit comments

Comments
 (0)