Skip to content

Commit

Permalink
Merge pull request #107 from nyaruka/s3_fetch_fix
Browse files Browse the repository at this point in the history
Always strip leading / from S3 keys
  • Loading branch information
rowanseymour authored Aug 22, 2024
2 parents 4f729ae + 54ee7cb commit dd31153
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 dd31153

Please sign in to comment.