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

Propfind response to trashbin endpoint is different in ocis #186

Closed
haribhandari07 opened this issue Aug 27, 2020 · 1 comment
Closed

Propfind response to trashbin endpoint is different in ocis #186

haribhandari07 opened this issue Aug 27, 2020 · 1 comment

Comments

@haribhandari07
Copy link

ocis

  1. delete a file file.txt
  2. propfind the trashbin endpoint
curl -k -u einstein:relativity -X PROPFIND https://localhost:9200/remote.php/dav/trash-bin/4c510ada-c86b-4815-8820-42cdf82c3d51 -H 'Depth: 2' --data '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop><oc:trashbin-original-filename/><oc:trashbin-original-location/><oc:trashbin-delete-timestamp/><d:getlastmodified/></d:prop>
</d:propfind>'    | xmllint --format -
  1. Response
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/trash-bin/</d:href>
    <d:propstat>
      <d:prop>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:trashbin-original-filename/>
        <oc:trashbin-original-location/>
        <oc:trashbin-delete-datetime/>
        <d:getcontentlength/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/trash-bin/file.txt.d1598510603</d:href>
    <d:propstat>
      <d:prop>
        <oc:trashbin-original-filename>file.txt</oc:trashbin-original-filename>
        <oc:trashbin-original-location>file.txt</oc:trashbin-original-location>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:trashbin-delete-timestamp/>
        <d:getlastmodified/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

core

  1. delete a file file.txt
  2. propfind the trashbin endpoint
curl -u admin:admin -X PROPFIND http://172.17.0.1/core2/remote.php/dav/trash-bin/admin -H 'Depth: 2' --data '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop><oc:trashbin-original-filename/><oc:trashbin-original-location/><oc:trashbin-delete-timestamp/><d:getlastmodified/></d:prop>
</d:propfind>'    | xmllint --format -
  1. Response
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/core2/remote.php/dav/trash-bin/admin/</d:href>
    <d:propstat>
      <d:prop>
        <oc:trashbin-original-filename/>
        <oc:trashbin-original-location/>
        <oc:trashbin-delete-timestamp/>
        <d:getlastmodified/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/core2/remote.php/dav/trash-bin/admin/2147504736</d:href>
    <d:propstat>
      <d:prop>
        <oc:trashbin-original-filename>file.txt</oc:trashbin-original-filename>
        <oc:trashbin-original-location>file.txt</oc:trashbin-original-location>
        <oc:trashbin-delete-timestamp>1598510277</oc:trashbin-delete-timestamp>
        <d:getlastmodified>Thu, 27 Aug 2020 06:37:24 GMT</d:getlastmodified>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/core2/remote.php/dav/trash-bin/admin/2147492242/</d:href>
    <d:propstat>
      <d:prop>
        <oc:trashbin-original-filename>folder2</oc:trashbin-original-filename>
        <oc:trashbin-original-location>folder1/folder2</oc:trashbin-original-location>
        <oc:trashbin-delete-timestamp>1596448440</oc:trashbin-delete-timestamp>
        <d:getlastmodified>Tue, 28 Jul 2020 07:22:15 GMT</d:getlastmodified>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Difference

In ocis for each <d:response> tag there are two <d:propstat> objects while in core for each <d:response> tag there is one <d:propstat> object

@haribhandari07 haribhandari07 added the bug Something isn't working label Aug 27, 2020
@exalate-issue-sync exalate-issue-sync bot added p3-medium and removed bug Something isn't working labels Mar 1, 2021
@ScharfViktor
Copy link

current response ocis version 4.0.0
image

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

No branches or pull requests

2 participants