"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 403 Forbidden for configuration personal onedrive
machsix8869a848f229
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.goindex 791ebba36..b454eee26 100644--- a/backend/onedrive/onedrive.go+++ b/backend/onedrive/onedrive.go@@ -549,31 +549,34 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest// We don't have the final ID yet?// query Microsoft Graphif opt.finalDriveID == "" {- _, err := srv.CallJSON(ctx, &opt.opts, nil, &drives)- if err != nil {- return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available drives: %v", err))+ _, drivesErr := srv.CallJSON(ctx, &opt.opts, nil, &drives)+ if drivesErr != nil {+ fs.Debugf(nil, "Failed to query /me/drives: %v - trying /me/drive", drivesErr)}-// Also call /me/drive as sometimes /me/drives doesn't return it #4068if opt.opts.Path == "/me/drives" {- opt.opts.Path = "/me/drive"+ meDriveOpts := opt.opts+ meDriveOpts.Path = "/me/drive"meDrive := api.DriveResource{}- _, err := srv.CallJSON(ctx, &opt.opts, nil, &meDrive)- if err != nil {- return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available drives: %v", err))- }- found := false- for _, drive := range drives.Drives {- if drive.DriveID == meDrive.DriveID {- found = true- break+ _, meDriveErr := srv.CallJSON(ctx, &meDriveOpts, nil, &meDrive)+ if meDriveErr == nil {+ found := false+ for _, drive := range drives.Drives {+ if drive.DriveID == meDrive.DriveID {+ found = true+ break+ }}+ // add the me drive if not found already+ if !found {+ fs.Debugf(nil, "Adding %v to drives list from /me/drive", meDrive)+ drives.Drives = append(drives.Drives, meDrive)+ }+ } else if drivesErr != nil {+ return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available drives: /me/drives: %v; /me/drive: %v", drivesErr, meDriveErr))}- // add the me drive if not found already- if !found {- fs.Debugf(nil, "Adding %v to drives list from /me/drive", meDrive)- drives.Drives = append(drives.Drives, meDrive)- }+ } else if drivesErr != nil {+ return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available drives: %v", drivesErr))}} else {drives.Drives = append(drives.Drives, api.DriveResource{