Skip to content

Explicit PROPFIND of getcontenttype returns 404 on folders #13313

Closed

Description

@SergioBertolinSG

Previous requirements

Have installed curl and optionally xmllint

Create a file called propfind.txt with this content:

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns">
<a:prop><a:getcontenttype/></a:prop>
<a:prop><oc:favorite/></a:prop>
</a:propfind>

Steps to reproduce

  1. Use curl to make a propfind request

Use your own credentials and host

curl -X PROPFIND -H "Content-Type: text/xml" http://USER:PASSWORD@HOST/owncloud/remote.php/webdav/FOLDER | xmllint --format -

Expected behaviour

to be detailed

Actual behaviour

getcontenttype returns a 404 not found in every folder always.

Server configuration

Operating system:
Ubuntu 14.04 LTS

Web server:
Apache

Database:
MySQL

PHP version:
5.5.9

ownCloud version: (see ownCloud admin page)
{"installed":true,"maintenance":false,"version":"8.0.0.1","versionstring":"8.0 alpha 1","edition":""}

Updated from an older ownCloud or fresh install:
fresh

List of activated apps:
none

The content of config/config.php:

Insert your config.php content here
(Without the database password and passwordsalt)

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes

Client configuration

Browser:
Chrome

Activity

  1. added this to the milestone on Jan 13, 2015
  2. DeepDiver1975 commented on Jan 13, 2015

    @DeepDiver1975
    Contributor

    @PVince81 some webdav fun for you? 🙊

  3. PVince81 commented on Jan 13, 2015

    @PVince81
    Contributor

    Yes, already discussed with @SergioBertolinSG on IRC.

    It seems that folders do not have content types.

    When doing a PROPFIND on a folder without a body (no explicitly requested attributes), you'll get the contents of the folder. For every file, there will be a "getcontenttype" attribute containing the mime type. However, folders do not have that attribute.

    However if you explicitly request the "getcontenttype" attribute through PROPFIND, you'll get it for files as before, but for folders it will put it in the 404 block. Not sure if this is expected or whether we should add code to prevent this case.
    Normally for any attribute that does not exist for an entity, the attribute would be put in the 404 block.

    @evert any clue what route to go here ?

  4. evert commented on Jan 13, 2015

    @evert

    This is expected behavior. Collections don't have a content-type, because a content-type only relates to the Content-Type header of what a GET request would return. Collections don't need to respond to GET requests.

  5. PVince81 commented on Jan 13, 2015

    @PVince81
    Contributor

    Okay, so the client should simply ignore the fact that "a:getcontenttype" appears in the 404 block, which shouldn't hurt.

    Does it mean that if no attributes were requested explicitly (default case), a:getcontenttype should also appear in a 404 block for consistency ?

  6. evert commented on Jan 13, 2015

    @evert

    No, it doesn't make sense for the 'allprop' case. It may help to read up on PROPFIND in rfc4918, as afaik, it should answer most of those questions.

  7. PVince81 commented on Jan 13, 2015

    @PVince81
    Contributor

    Okay, thanks for the clarification.
    Closing this as this is the expected behavior.

  8. locked as resolved and limited conversation to collaborators on Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions