zoho: fix large file overwrite creating a duplicate instead of replacing - fixes #9585
The /stream/upload endpoint's overwrite flag is the x-prefixed header x-override-name-exist, matching its siblings x-filename, x-parent_id and x-streammode. uploadLargeFile sent the un-prefixed override-name-exist, which the endpoint ignores, so overwriting a file of 10 MiB or larger created a renamed duplicate instead of updating the existing file. The small upload API passes the flag as a query parameter and is unaffected.
This commit is contained in:
committed by
Nick Craig-Wood
parent
2b099f2667
commit
037340b1b5
@@ -1175,11 +1175,13 @@ func (f *Fs) uploadLargeFile(ctx context.Context, name string, parent string, si
|
||||
ContentType: "application/octet-stream",
|
||||
Options: options,
|
||||
ExtraHeaders: map[string]string{
|
||||
"x-filename": url.QueryEscape(name),
|
||||
"x-parent_id": parent,
|
||||
"override-name-exist": "true",
|
||||
"upload-id": uuid.New().String(),
|
||||
"x-streammode": "1",
|
||||
"x-filename": url.QueryEscape(name),
|
||||
"x-parent_id": parent,
|
||||
// Must carry the x- prefix; without it the stream endpoint ignores
|
||||
// the flag and creates a duplicate instead of overwriting.
|
||||
"x-override-name-exist": "true",
|
||||
"upload-id": uuid.New().String(),
|
||||
"x-streammode": "1",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user