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

This commit is contained in:
Alex Chen 2021-01-06 10:50:37 +08:00 committed by GitHub
parent dd67a3d5f5
commit c66b901320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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", "/copy?@microsoft.graph.conflictBehavior=replace")
opts.ExtraHeaders = map[string]string{"Prefer": "respond-async"}
opts.NoResponse = true