fix(s3): escape CopySource request header when copying files (#7860 close #7858)

pull/7859/merge
Jiang Xiang 2025-01-27 20:23:13 +08:00 committed by GitHub
parent 267120a8c8
commit 99f39410f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/http"
"net/url"
"path"
"strings"
@ -198,7 +199,7 @@ func (d *S3) copyFile(ctx context.Context, src string, dst string) error {
dstKey := getKey(dst, false)
input := &s3.CopyObjectInput{
Bucket: &d.Bucket,
CopySource: aws.String("/" + d.Bucket + "/" + srcKey),
CopySource: aws.String(url.PathEscape("/" + d.Bucket + "/" + srcKey)),
Key: &dstKey,
}
_, err := d.client.CopyObject(input)