Skip to content

Commit

Permalink
fix(s3): escape CopySource request header when copying files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Fly committed Jan 22, 2025
1 parent 11b6a60 commit f2b8746
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/s3/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/http"
"net/url"
"path"
"strings"

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f2b8746

Please sign in to comment.