fix(s3): incorrect copy key with plus sign (#1820)

This commit is contained in:
TwoOnefour
2025-12-22 00:15:58 +08:00
committed by GitHub
parent 216f071e64
commit d6dd62dfe5

View File

@@ -217,9 +217,10 @@ func (d *S3) copy(ctx context.Context, src string, dst string, isDir bool) error
func (d *S3) copyFile(ctx context.Context, src string, dst string) error {
srcKey := getKey(src, false)
dstKey := getKey(dst, false)
encodedKey := strings.ReplaceAll(url.PathEscape(d.Bucket+"/"+srcKey), "+", "%2B")
input := &s3.CopyObjectInput{
Bucket: &d.Bucket,
CopySource: aws.String(url.PathEscape(d.Bucket + "/" + srcKey)),
CopySource: aws.String(encodedKey),
Key: &dstKey,
}
_, err := d.client.CopyObject(input)