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

valid WebDAV (DELETE, COPY or MOVE) requests with body must exit with 415 #4332

Closed
grgprarup opened this issue Aug 4, 2022 · 2 comments
Closed
Labels

Comments

@grgprarup
Copy link
Contributor

Describe the bug

valid webDAV DELETE, COPY, or MOVE requests should not send a body in the request.
https://datatracker.ietf.org/doc/html/rfc4918#section-8.4

If a body is sent, then the server is supposed to return HTTP status 415 (Unsupported Media Type).

This has been implemented in reva PR cs3org/reva#2974 for MOVE requests and might need implementation for COPY and DELETE requests.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create user uu1
  2. Create a file test.txt
curl -ks -uuu1:uu1 -XCOPY -H "DESTINATION: https://localhost:9200/remote.php/webdav/test2.txt" --data "doesnotmatter"  https://localhost:9200/remote.php/webdav/test.txt -v
curl -ks -uuu1:uu1 -XDELETE --data "doesnotmatter"  https://localhost:9200/remote.php/webdav/test.txt -v 

Expected behavior

If a body is sent, then the server is supposed to return HTTP status 415 (Unsupported Media Type).
COPY: HTTP/1.1 415 Unsupported Media Type
DELETE: HTTP/1.1 415 Unsupported Media Type

Actual behavior

If a body is sent, then the body is ignored and the requests executed successfully.
COPY: HTTP/1.1 201 Created
DELETE: HTTP/1.1 204 No Content

@kiranparajuli589 kiranparajuli589 changed the title Valid requests with body must give 415 (Unsupported Media Type) valid WebDAV (DELETE, COPY or MOVE) requests with body must exit with 415 Aug 18, 2022
@micbar
Copy link
Contributor

micbar commented Nov 25, 2022

fixed by #5131

@grgprarup
Copy link
Contributor Author

The issue is fixed with PR #5131. And verified with a curl request, which gives a response as expected.

curl -ks -uuu1:uu1 -XCOPY -H "DESTINATION: https://localhost:9200/remote.php/webdav/test2.txt" --data "doesnotmatter"  https://localhost:9200/remote.php/webdav/test.txt -v

HTTP/1.1 415 Unsupported Media Type

curl -ks -uuu1:uu1 -XDELETE --data "doesnotmatter"  https://localhost:9200/remote.php/webdav/test.txt -v 

HTTP/1.1 415 Unsupported Media Type
So closing this issue.

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

2 participants