Skip to content

Commit

Permalink
s3: wrap etag in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Sep 3, 2024
1 parent ce2b3ca commit 9ddcc41
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions worker/s3/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s *s3) ListBucket(ctx context.Context, bucketName string, prefix *gofakes3
item := &gofakes3.Content{
Key: key,
LastModified: gofakes3.NewContentTime(object.ModTime.Std()),
ETag: object.ETag,
ETag: api.FormatETag(object.ETag),
Size: object.Size,
StorageClass: gofakes3.StorageStandard,
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func (s *s3) PutObject(ctx context.Context, bucketName, key string, meta map[str
}

return gofakes3.PutObjectResult{
ETag: ur.ETag,
ETag: api.FormatETag(ur.ETag),
VersionID: "", // not supported
}, nil
}
Expand Down Expand Up @@ -452,7 +452,9 @@ func (s *s3) UploadPart(ctx context.Context, bucket, object string, id gofakes3.
return nil, gofakes3.ErrorMessage(gofakes3.ErrInternal, err.Error())
}

return &gofakes3.UploadPartResult{ETag: res.ETag}, nil
return &gofakes3.UploadPartResult{
ETag: api.FormatETag(res.ETag),
}, nil
}

func (s *s3) ListMultipartUploads(ctx context.Context, bucket string, marker *gofakes3.UploadListMarker, prefix gofakes3.Prefix, limit int64) (*gofakes3.ListMultipartUploadsResult, error) {
Expand Down Expand Up @@ -502,7 +504,7 @@ func (s *s3) ListParts(ctx context.Context, bucket, object string, uploadID gofa
parts = append(parts, gofakes3.ListMultipartUploadPartItem{
PartNumber: part.PartNumber,
LastModified: gofakes3.NewContentTime(part.LastModified.Std()),
ETag: part.ETag,
ETag: api.FormatETag(part.ETag),
Size: part.Size,
})
}
Expand Down Expand Up @@ -532,7 +534,7 @@ func (s *s3) CompleteMultipartUpload(ctx context.Context, bucket, object string,
var parts []api.MultipartCompletedPart
for _, part := range input.Parts {
parts = append(parts, api.MultipartCompletedPart{
ETag: part.ETag,
ETag: api.FormatETag(part.ETag),
PartNumber: part.PartNumber,
})
}
Expand Down

0 comments on commit 9ddcc41

Please sign in to comment.