Skip to content

Commit d6dd62d

Browse files
authored
fix(s3): incorrect copy key with plus sign (#1820)
1 parent 216f071 commit d6dd62d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/s3/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,10 @@ func (d *S3) copy(ctx context.Context, src string, dst string, isDir bool) error
217217
func (d *S3) copyFile(ctx context.Context, src string, dst string) error {
218218
srcKey := getKey(src, false)
219219
dstKey := getKey(dst, false)
220+
encodedKey := strings.ReplaceAll(url.PathEscape(d.Bucket+"/"+srcKey), "+", "%2B")
220221
input := &s3.CopyObjectInput{
221222
Bucket: &d.Bucket,
222-
CopySource: aws.String(url.PathEscape(d.Bucket + "/" + srcKey)),
223+
CopySource: aws.String(encodedKey),
223224
Key: &dstKey,
224225
}
225226
_, err := d.client.CopyObject(input)

0 commit comments

Comments
 (0)