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

REPORT request return multi-status 207 even there is no personal-space-id in space dav-path-version endpoint #7104

Closed
nabim777 opened this issue Aug 23, 2023 · 7 comments
Labels

Comments

@nabim777
Copy link
Member

Describe the bug

When making a report request without having personal-spaces-id on the endpoint, it returns a response of multi-status 207 result.
This bug also occurs while sharee do report request and there is no sharee-personal-space-id at the endpoint. That also returns multi-status 207.

Steps to reproduce

Steps to reproduce the behavior:

  1. As einstein, created a file file.txt
  2. As einstein, search resources using file through API
curl -kv -XREPORT https://localhost:9200/dav/spaces/ \                                                                                                                                
-u einstein:relativity \
-d "<?xml version='1.0' encoding='utf-8' ?>
<oc:search-files xmlns:a='DAV:' xmlns:oc='http://owncloud.org/ns' >
<oc:search>
<oc:pattern>file</oc:pattern>
</oc:search>
</oc:search-files>" | xmllint --format -

Expected behavior

There should be a return 404 status code
< HTTP/1.1 404 Not Found
. . . 
< 
{ [19 bytes data]
100   200  100    19  100   181    363   3466 --:--:-- --:--:-- --:--:--  3846
* Connection #0 to host localhost left intact
-:1: parser error : Start tag expected, '<' not found
404 page not found
^

Actual behavior

without einstein-personal-space-id in the endpoint
< HTTP/1.1 207 Multi-Status
. . .
<?xml version="1.0"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/spaces/2b17cd6e-5ce0-468c-b474-b382c0f79e30$4c510ada-c86b-4815-8820-42cdf82c3d51/file11.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>2b17cd6e-5ce0-468c-b474-b382c0f79e30$4c510ada-c86b-4815-8820-42cdf82c3d51!ac323d5a-8bbe-4362-b481-393024d5a3db</oc:fileid>
        <oc:file-parent>2b17cd6e-5ce0-468c-b474-b382c0f79e30$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51</oc:file-parent>
        <oc:name>file11.txt</oc:name>
        <d:getlastmodified>2023-08-23T05:55:55Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>RDNVW</oc:permissions>
        <oc:highlights/>
        <oc:tags/>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>0</d:getcontentlength>
        <oc:score>1.4402849674224854</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
@saw-jan
Copy link
Member

saw-jan commented Sep 8, 2023

I think, this is the expected behavior. Web also makes use of this.

Screenshot from 2023-09-08 11-55-53

CC @ScharfViktor

@ScharfViktor
Copy link
Contributor

CC @ScharfViktor

Yes, that expected. -XREPORT https://localhost:9200/dav/spaces/ and -XREPORT https://localhost:9200/dav/spaces/spaceUUID behave the same way.
Question: do we need adapt test for that?

@saw-jan
Copy link
Member

saw-jan commented Sep 8, 2023

It depends whether we want to have tests with .../dav/spaces/ or .../dav/spaces/<personal-space-id>

@saw-jan
Copy link
Member

saw-jan commented Sep 8, 2023

Also, I noticed that there is no difference in using
.../dav/spaces/<personal-space-id>
and
.../dav/spaces/<project-space-id>
both gives same result.
was it expected? similar issue #7096

@saw-jan
Copy link
Member

saw-jan commented Sep 8, 2023

both gives same result.

If using spaces id gives same result (if expected to be) then I think we have to refactor it in the tests also.

@ScharfViktor
Copy link
Contributor

That is mess 😭
using REPORT https://localhost:9200/remote.php/dav/spaces/ without spaceUUID seams logic.
we set location:

  • for REPORT request in body.
  • for PROPFIND request in url.

so the developers cut off everything beyond /remote.php/dav/spaces/ in the REPORT request #7096

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