Skip to content

Webdav: REPORT vs PROPFIND behaves different in MultiStatus, thus parsing fails #15029

Description

@tobiasKaminsky

To have faster favorites, I wanted to use REPORT instead of SEARCH on Android.
We already use MultiStatusResponse when reading a folder (and we rely on our dav library for this).

Following is the same folder result, one retrieved via REPORT and one via PROPFIND:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:nc="http://nextcloud.org/ns" xmlns:oc="http://owncloud.org/ns">
    <d:response>
        <d:href>/nc/remote.php/webdav/testFolder/</d:href>
        <d:propstat>
            <d:prop>
                <oc:owner-id>test</oc:owner-id>
                <d:getetag>&quot;5cad995a5281a&quot;</d:getetag>
                <oc:permissions>RGDNVCK</oc:permissions>
                <d:getlastmodified>Wed, 10 Apr 2019 07:20:58 GMT</d:getlastmodified>
                <oc:id>00080126ocjycgrudn78</oc:id>
                <oc:favorite>1</oc:favorite>
                <nc:mount-type></nc:mount-type>
                <nc:note></nc:note>
                <nc:has-preview>false</nc:has-preview>
                <oc:size>0</oc:size>
                <nc:is-encrypted>0</nc:is-encrypted>
                <oc:owner-display-name>test</oc:owner-display-name>
                <oc:comments-unread>0</oc:comments-unread>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop>
                <d:creationdate />
                <d:getcontentlength />
                <d:getcontenttype />
            </d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>

REPORT:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
    <d:response>
        <d:status>HTTP/1.1 200 OK</d:status>
        <d:href>/nc/remote.php/dav/files/test/testFolder</d:href>
        <d:propstat>
            <d:prop>
                <oc:owner-id>test</oc:owner-id>
                <d:getetag>&quot;5cad995a5281a&quot;</d:getetag>
                <oc:permissions>RGDNVCK</oc:permissions>
                <d:getlastmodified>Wed, 10 Apr 2019 07:20:58 GMT</d:getlastmodified>
                <oc:id>00080126ocjycgrudn78</oc:id>
                <oc:favorite>1</oc:favorite>
                <nc:mount-type></nc:mount-type>
                <nc:note></nc:note>
                <nc:has-preview>false</nc:has-preview>
                <oc:size>0</oc:size>
                <nc:is-encrypted>0</nc:is-encrypted>
                <oc:owner-display-name>test</oc:owner-display-name>
                <oc:comments-unread>0</oc:comments-unread>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop>
                <d:creationdate/>
                <d:getcontentlength/>
                <d:getcontenttype/>
            </d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>

The only difference is that in REPORT we have an additional
<d:status>HTTP/1.1 200 OK</d:status> as child of response.
And this confuse our lib in a way that it does not parse propstat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions