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

Overwrite:T header is not specified after confirming overwrite #7736

Closed
cyberduck opened this issue Jan 15, 2014 · 3 comments
Closed

Overwrite:T header is not specified after confirming overwrite #7736

cyberduck opened this issue Jan 15, 2014 · 3 comments
Assignees
Labels
bug webdav WebDAV Protocol Implementation worksforme
Milestone

Comments

@cyberduck
Copy link
Collaborator

6ee46a5 created the issue

Cyberduck nicely prompts when it detects that the user is going to override a file. However, after confirming the client does not send the "Overwrite: T" header. The server is required to return 412 in this case I believe.

@cyberduck
Copy link
Collaborator Author

6ee46a5 commented

This seems to fix it. If you want to explicitly track whether the user has hit "overwrite" I suppose that would go in the TransferOptions, but that's not passed down this far.

Index: source/ch/cyberduck/core/dav/DAVWriteFeature.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- source/ch/cyberduck/core/dav/DAVWriteFeature.java	(revision 14207)
+++ source/ch/cyberduck/core/dav/DAVWriteFeature.java	(revision )
@@ -41,7 +41,7 @@
 import com.github.sardine.impl.handler.ETagResponseHandler;
 
 /**
- * @version $Id: DAVWriteFeature.java 14205 2014-01-15 01:32:31Z dkocher $
+ * @version $Id: DAVWriteFeature.java 14205 2014-01-13 22:33:09Z dkocher $
  -/
 public class DAVWriteFeature extends AbstractHttpWriteFeature<String> implements Write {
 
@@ -69,6 +69,7 @@
                     status.getCurrent(), status.getLength() - 1, status.getLength())
             );
         }
+        headers.put("Overwrite","T");
         if(expect) {
             headers.put(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
         }

@cyberduck
Copy link
Collaborator Author

@dkocher commented

The Overwrite header is only specified for COPY and MOVE methods in RFC 2518. PUT is part of standard HTTP and always overwrites the resource from my understanding.

@cyberduck
Copy link
Collaborator Author

6ee46a5 commented

Thanks for investigating.

@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 webdav WebDAV Protocol Implementation worksforme
Projects
None yet
Development

No branches or pull requests

2 participants