mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-03-15 03:20:32 +00:00
fix(s3): incorrect copy key with plus sign (#1820)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user