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

even though we append any keyword at the end of the endpoints during the report request, we get a 207 status response. #7096

Closed
nabim777 opened this issue Aug 22, 2023 · 1 comment
Labels

Comments

@nabim777
Copy link
Member

Describe the bug

All dav-path-version endpoint accept any keyword at last while doing REPORT request

curl -kv -XREPORT https://localhost:9200/remote.php/dav/spaces/kegfoihfoiefpwpowugwr \                                                                                                  
-u admin:admin \
-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 -

Here is the endpoint https://localhost:9200/remote.php/dav/spaces/kegfoihfoiefpwpowugwr in which there is any keyword, no matter its length, at the end. With this endpoint also there is the response of 207 multi-status.

Steps to reproduce

Steps to reproduce the behavior:

  1. As admin, create a file1.txt
  2. As admin, search resources using file1 through API
for old dav path version
curl -kv -XREPORT https://localhost:9200/webdav<any-key-word-of-any-length> \                                                                                                                        
-u admin:admin \
-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 -
for new dav path version
curl -kv -XREPORT https://localhost:9200/dav/files<any-key-word-of-any-length>\                                                                                                                                    
-u admin:admin \
-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 -
for spaces dav path version
curl -kv -XREPORT https://localhost:9200/remote.php/dav/spaces<any-key-word-of-any-length> \                                                                                                                        
-u admin:admin \
-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

for all dav path version responses are same and gives 207 multi-status
< 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$b4d524df-bc88-4546-9fee-f935c626d403/file.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>2b17cd6e-5ce0-468c-b474-b382c0f79e30$b4d524df-bc88-4546-9fee-f935c626d403!d32ff2aa-b886-4f1e-9ffc-28ff9e1989d4</oc:fileid>
        <oc:file-parent>2b17cd6e-5ce0-468c-b474-b382c0f79e30$b4d524df-bc88-4546-9fee-f935c626d403!b4d524df-bc88-4546-9fee-f935c626d403</oc:file-parent>
        <oc:name>file.txt</oc:name>
        <d:getlastmodified>2023-08-22T11:07:33Z</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.3065004348754883</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 14, 2023

#7104 (comment)

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.

My suggestion, accept it as it is and close issues:

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