Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

onedrive: (business only) workaround to replace existing file on server-side copy (#4904)

Alex Chenc66b90132000
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index 6a8c2e78e..cade6eef1 100755
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -1063,7 +1063,8 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
}
// Copy the object
- opts := newOptsCall(srcObj.id, "POST", "/copy")
+ // The query param is a workaround for OneDrive Business for #4590
+ opts := newOptsCall(srcObj.id, "POST", "/[email protected]=replace")
opts.ExtraHeaders = map[string]string{"Prefer": "respond-async"}
opts.NoResponse = true