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

MOVE a file into same folder with same name returns 404 instead of 403 #1976

Open
saw-jan opened this issue Apr 28, 2021 · 6 comments
Open
Labels

Comments

@saw-jan
Copy link
Member

saw-jan commented Apr 28, 2021

From https://www.rfc-editor.org/rfc/rfc4918#section-9.9.4

403 (Forbidden) - Among many possible reasons for forbidding a MOVE
operation, this status code is recommended for use when the source
and destination resources are the same.

In oCIS

curl -X MOVE -u admin:admin https://localhost:9200/remote.php/dav/files/admin/parent.txt \
-H "Destination: https://localhost:9200/remote.php/dav/files/admin/parent.txt" -v

Response:

< HTTP/1.1 404 Not Found

<?xml version="1.0" encoding="UTF-8"?>
<d:error
	xmlns:d="DAV"
	xmlns:s="http://sabredav.org/ns">
	<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
	<s:message>move: error: not found: 854988f3-a286-4076-a8ca-44d54cf03a08/parent.txt</s:message>
</d:error>

❗ file is then deleted and moved to the trashbin

In oC10

curl -X MOVE -u admin:admin http://localhost/core/remote.php/dav/files/admin/parent.txt \
-H "Destination: http://localhost/core/remote.php/dav/files/admin/parent.txt" -v 

Response

< HTTP/1.1 403 Forbidden

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
  <s:message>Source and destination uri are identical.</s:message>
</d:error>
@saw-jan saw-jan changed the title Moving a file into same folder with same name returns 404 instead of 403 MOVE a file into same folder with same name returns 404 instead of 403 Apr 28, 2021
@ScharfViktor
Copy link
Contributor

ScharfViktor commented Sep 8, 2021

I can confirm that this is happening. local server oCIS version 1.11.0

curl -X MOVE -u admin:admin https://localhost:9200/remote.php/webdav/parent.txt \ -H "Destination: https://localhost:9200/remote.php/webdav/parent.txt" -v get 404 and move file to trash

But web blocks this behavior.

@ScharfViktor ScharfViktor added the Priority:p4-low Low priority label Sep 8, 2021
@saw-jan
Copy link
Member Author

saw-jan commented Apr 6, 2022

re-tested with oCIS 1.19.1, still relevant

@amrita-shrestha
Copy link
Contributor

re-tested with ocis 3.1.0-rc.1+712d98e0a2, still relevant

@saw-jan
Copy link
Member Author

saw-jan commented Jan 5, 2024

This deletes the file and moves it to the trashbin. So I think it should be treated with similar prio as bug #6739

CC @ScharfViktor

@saw-jan
Copy link
Member Author

saw-jan commented Jan 5, 2024

@saw-jan

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants