Skip to content

Commit

Permalink
Always strip leading / from S3 keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Aug 22, 2024
1 parent 4f729ae commit 54ee7cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archives/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 54ee7cb

Please sign in to comment.