From 54ee7cb82c3df797203b476801e1a813b56ceb61 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 22 Aug 2024 18:38:02 -0500 Subject: [PATCH] Always strip leading / from S3 keys --- archives/s3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archives/s3.go b/archives/s3.go index 6a599c1..3e7aa1a 100644 --- a/archives/s3.go +++ b/archives/s3.go @@ -118,7 +118,7 @@ func GetS3FileInfo(ctx context.Context, s3Client *s3x.Service, fileURL string) ( } bucket := strings.Split(u.Host, ".")[0] - path := u.Path + path := strings.TrimPrefix(u.Path, "/") head, err := s3Client.Client.HeadObject( ctx, @@ -150,7 +150,7 @@ func GetS3File(ctx context.Context, s3Client *s3x.Service, fileURL string) (io.R } bucket := strings.Split(u.Host, ".")[0] - path := u.Path + path := strings.TrimPrefix(u.Path, "/") output, err := s3Client.Client.GetObject( ctx,