nextcloud / nextcloud/server

REPORT does not show contenttype

Open
#17,586 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 26-feedback bug feature: dav
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Using

curl --request REPORT \
  --url http://localhost/nc/remote.php/dav/files/tobi/ \
  --header 'authorization: Basic dG9iaTpTSGZ6ZC04YkQyNC1xOUtSaS1zU2NRay03ZHh4eA==' \
  --data '<?xml version="1.0" encoding="UTF-8"?>
<oc:filter-files xmlns:oc="http://owncloud.org/ns">
    <oc:filter-rules>
        <oc:favorite>1</oc:favorite>
    </oc:filter-rules>
    <D:prop xmlns:D="DAV:">
        <oc:owner-id />
        <D:creationdate />
        <D:getetag />
        <oc:permissions />
        <D:getlastmodified />
        <oc:id />
        <D:getcontentlength />
        <oc:favorite />
        <nc:mount-type xmlns:nc="http://nextcloud.org/ns" />
        <nc:note xmlns:nc="http://nextcloud.org/ns" />
        <D:getcontenttype />
        <nc:has-preview xmlns:nc="http://nextcloud.org/ns" />
        <oc:size />
        <nc:is-encrypted xmlns:nc="http://nextcloud.org/ns" />
        <oc:owner-display-name />
        <oc:comments-unread />
    </D:prop>
</oc:filter-files>'

I do not get a contenttype on folders:

<d:response>
    <d:status>HTTP/1.1 200 OK</d:status>
    <d:href>/nc/remote.php/dav/files/tobi/InstantUpload</d:href>
    <d:propstat>
      <d:prop>
        <oc:owner-id>tobi</oc:owner-id>
        <d:getetag>&quot;5da5a10e3b3d5&quot;</d:getetag>
        <oc:permissions>RGDNVCK</oc:permissions>
        <d:getlastmodified>Tue, 15 Oct 2019 10:35:58 GMT</d:getlastmodified>
        <oc:id>00000984ocjycgrudn78</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>28800316</oc:size>
        <nc:is-encrypted>0</nc:is-encrypted>
        <oc:owner-display-name>Kaminsky Tobias</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>

same for
<d:creationdate/>
nc:is-encrypted/
<d:creationdate/>
<d:getcontentlength/>
<d:getcontenttype/>

@nextcloud/server-triage can someone confirm this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied curl REPORT request against a Nextcloud server and inspect the XML response for folder properties. Trace the REPORT handling and property generation until you can identify why getcontenttype returns 404 for folders; done means the response includes the expected content type for folders and the existing properties remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.