Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDAV: Rename specifies Overwrite F when overwriting an existing file/folder #4427

Closed
cyberduck opened this issue Apr 26, 2010 · 2 comments
Closed
Assignees
Labels
bug fixed webdav WebDAV Protocol Implementation
Milestone

Comments

@cyberduck
Copy link
Collaborator

Chris Byrne created the issue

When renaming a folder/file the user is asked if they want to overwrite the destination if it already exists. This rename fails with a conformant WebDAV server as the Overwrite header is set to F.

From RFC 4918 http://www.webdav.org/specs/rfc4918.html#METHOD_MOVE

If a resource exists at the destination and the Overwrite header is "T", then prior to performing the move, the server must perform a DELETE with "Depth: infinity" on the destination resource. If the Overwrite header is set to "F", then the operation will fail.

-Steps to reproduce:*

  1. Create two folders "a" and "b"
  2. Rename "b" to "a"
  3. Yes, you want to rename the existing file

-Expected Results:*

Folder "a" to be deleted, and folder "b" to be renamed to "a"

-Actual Results:*

I/O Error: Cannot rename folder

MOVE /files/b HTTP/1.1[\r][\n]
Authorization: Basic Y2hyaXM6[\r][\n]
User-Agent: Cyberduck/3.4.2 (5902) (Mac OS X/10.5.8) (i386)[\r][\n]
Host: 172.16.50.204[\r][\n]
Content-Length: 0[\r][\n]
Destination: http://172.16.50.204/files/a[\r][\n]
Overwrite: F[\r][\n]
[\r][\n]
HTTP/1.1 409 Precondition Failed[\r][\n]
HTTP/1.1 409 Precondition Failed[\r][\n]
Content-Length: 215[\r][\n]
Connection: Keep-Alive[\r][\n]
[\r][\n]

Where the precondition failure is:

The requested destination "http://172.16.50.204/files/b" is already mapped to a resource

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We should omit the header because every overwrite is confirmed in the user interface.

From (http://www.webdav.org/specs/rfc4918.html#HEADER_Overwrite):

If the overwrite header is not included in a COPY or MOVE request, then the resource must treat the request as if it has an overwrite header of value "T".

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In b1d022d.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed webdav WebDAV Protocol Implementation
Projects
None yet
Development

No branches or pull requests

2 participants