UPDATE: fix bug
All checks were successful
Build and Release / release (push) Successful in 1m2s

This commit is contained in:
2026-04-09 19:07:45 +07:00
parent eb6e41d7b3
commit 85d6295365

View File

@@ -90,10 +90,7 @@ func NewS3Storage() (Storage, error) {
client := s3.NewFromConfig(cfg, func(o *s3.Options) { client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(endpoint) o.BaseEndpoint = aws.String(endpoint)
o.UsePathStyle = true o.UsePathStyle = true
o.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired
o.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired
}) })
return &s3Storage{ return &s3Storage{
client: client, client: client,
ps: s3.NewPresignClient(client), ps: s3.NewPresignClient(client),
@@ -109,10 +106,9 @@ func (s *s3Storage) Move(ctx context.Context, src *MoveOptions, dest *MoveOption
copySource := fmt.Sprintf("%s/%s", src.Bucket, url.PathEscape(src.Key)) copySource := fmt.Sprintf("%s/%s", src.Bucket, url.PathEscape(src.Key))
_, err := s.client.CopyObject(ctx, &s3.CopyObjectInput{ _, err := s.client.CopyObject(ctx, &s3.CopyObjectInput{
Bucket: aws.String(dest.Bucket), Bucket: aws.String(dest.Bucket),
Key: aws.String(dest.Key), Key: aws.String(dest.Key),
CopySource: aws.String(copySource), CopySource: aws.String(copySource),
MetadataDirective: types.MetadataDirectiveCopy,
}) })
if err != nil { if err != nil {
return fmt.Errorf("failed to copy object: %w", err) return fmt.Errorf("failed to copy object: %w", err)