[rest] Renaming a file into a folder overwrites the folder
Bug #987767 reported by
Roman Yepishev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu One Servers |
Triaged
|
Undecided
|
Ubuntu One Foundations+ team |
Bug Description
STR:
1. Create a directory with rest api - "/dirname"
2. Create upload a file with rest api - "/filename.bin"
3. Perform a rename with rest api with data = '{"path": "/dirname"} on "/filename.bin"
Expected results:
The file will be moved into the directory or the operation fails
Actual results:
The file overwrites the directory
visibility: | private → public |
Changed in ubuntuone-servers: | |
status: | New → Triaged |
assignee: | nobody → Ubuntu One Foundations+ team (ubuntuone-foundations+) |
tags: | added: foundations+ |
To post a comment you must log in.
While it doesn't necessarily address the directory overwrite case, perhaps it would be useful to provide a way to tell the API that a particular invocation of this API is not intended to overwrite anything at the destination. If the call would cause an overwrite in this case, then it returns an error. The client can then decide what to do in that case (e.g. prompt the user for confirmation and repeat the call without disallowing overwrite).
This is the approach WebDAV took, for instance, where setting the "Overwrite" header to "F" will cause a COPY or MOVE request to return a "409 Conflict" response.