Skip to content

Commit

Permalink
onedrive: (business only) workaround to replace existing file on serv…
Browse files Browse the repository at this point in the history
…er-side copy (rclone#4904)
  • Loading branch information
Cnly authored and negative0 committed Aug 13, 2021
1 parent 418ee8c commit cf2b493
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/onedrive/onedrive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cf2b493

Please sign in to comment.