"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
onedrive: fix URL escaping in file names - eg uploading files with `+` in them.
Nick Craig-Wood79eebf19939d
diff --git a/onedrive/onedrive.go b/onedrive/onedrive.goindex 1942948ac..adc27a6a5 100644--- a/onedrive/onedrive.go+++ b/onedrive/onedrive.go@@ -8,6 +8,7 @@ import ("io""log""net/http"+ "net/url""regexp""strings""time"@@ -145,7 +146,7 @@ func shouldRetry(resp *http.Response, err error) (bool, error) {func (f *Fs) readMetaDataForPath(path string) (info *api.Item, resp *http.Response, err error) {opts := rest.Opts{Method: "GET",- Path: "/drive/root:/" + replaceReservedChars(path),+ Path: "/drive/root:/" + url.QueryEscape(replaceReservedChars(path)),}err = f.pacer.Call(func() (bool, error) {resp, err = f.srv.CallJSON(&opts, nil, &info)@@ -738,7 +739,7 @@ func (o *Object) ModTime() time.Time {func (o *Object) setModTime(modTime time.Time) (*api.Item, error) {opts := rest.Opts{Method: "PATCH",- Path: "/drive/root:/" + o.srvPath(),+ Path: "/drive/root:/" + url.QueryEscape(o.srvPath()),}update := api.SetFileSystemInfo{FileSystemInfo: api.FileSystemInfoFacet{@@ -793,7 +794,7 @@ func (o *Object) Open() (in io.ReadCloser, err error) {func (o *Object) createUploadSession() (response *api.CreateUploadResponse, err error) {opts := rest.Opts{Method: "POST",- Path: "/drive/root:/" + o.srvPath() + ":/upload.createSession",+ Path: "/drive/root:/" + url.QueryEscape(o.srvPath()) + ":/upload.createSession",}var resp *http.Responseerr = o.fs.pacer.Call(func() (bool, error) {@@ -903,7 +904,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {var resp *http.Responseopts := rest.Opts{Method: "PUT",- Path: "/drive/root:/" + o.srvPath() + ":/content",+ Path: "/drive/root:/" + url.QueryEscape(o.srvPath()) + ":/content",Body: in,}err = o.fs.pacer.CallNoRetry(func() (bool, error) {