S3fs: Handle non-ascii filename in rename operations (#257)
SFTP is based on UTF-8 filenames, so non-ASCII filenames get transported with utf-8 escaped character sequences. At least for the S3fs provider, if such a file is stored in a nested path it cannot be used as the source for a rename operations. This adds the necessary escaping of the path fragments. The patch is not required for MinIO but it doesn't hurt
This commit is contained in:
parent
187a5b1908
commit
5b1d8666b3
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"mime"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
@ -297,7 +298,7 @@ func (fs *S3Fs) Rename(source, target string) error {
|
|||
defer cancelFn()
|
||||
_, err = fs.svc.CopyObjectWithContext(ctx, &s3.CopyObjectInput{
|
||||
Bucket: aws.String(fs.config.Bucket),
|
||||
CopySource: aws.String(copySource),
|
||||
CopySource: aws.String(url.PathEscape(copySource)),
|
||||
Key: aws.String(target),
|
||||
StorageClass: utils.NilIfEmpty(fs.config.StorageClass),
|
||||
ContentType: utils.NilIfEmpty(contentType),
|
||||
|
|
Loading…
Add table
Reference in a new issue