ocis
ocis copied to clipboard
Custom dav properties with namespaces are rendered incorrectly
Describe the bug
Custom dav properties in dav response are rendered incorrectly
Steps to reproduce
Steps to reproduce the behavior:
https://github.com/owncloud/core/blob/076ddc7dc430e1e80d23b374d13c73f199cb398a/tests/acceptance/features/apiWebdavProperties1/setFileProperties.feature#L24
Expected behavior
custom dav properties with namespace rendered as in oc10
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:s="http://sabredav.org/ns">
<d:response>
<d:href>/core/remote.php/dav/files/Alice/testcustomprop.txt</d:href>
<d:propstat>
<d:prop>
<x1:very-custom-prop xmlns:x1="http://whatever.org/ns">
<x2:foo xmlns:x2="http://bar" />
</x1:very-custom-prop>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
Actual behavior
dav properties are rendered incorrectly in the xml
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:s="http://sabredav.org/ns">
<d:response>
<d:href>/remote.php/dav/files/Alice/testcustomprop.txt</d:href>
<d:propstat>
<d:prop>
<very-custom-prop xmlns="http://whatever.org/ns"><foo xmlns='http://bar'/></very-custom-prop>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
Setup
Please describe how you started the server and provide a list of relevant environment variables.
OCIS_VERSION=git
BRANCH=master
STORAGE_FRONTEND_UPLOAD_DISABLE_TUS=false
Additional context
Add any other context about the problem here.
The behavior still exists: 1. PROPPATCH
curl -XPROPPATCH "https://localhost:9200/remote.php/dav/files/admin/file.txt" \
-d'<?xml version="1.0"?><d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:set><d:prop><x1:very-custom-prop xmlns:x1="http://whatever.org/ns">veryCustomPropValue</x1:very-custom-prop></d:prop></d:set></d:propertyupdate>' \
-u admin:admin -vk | xmllint --format -
Actual:
<d:prop>
<very-custom-prop xmlns="http://whatever.org/ns"/>
</d:prop>
Expected:
<d:prop>
<x1:very-custom-prop xmlns:x1="http://whatever.org/ns"/>
</d:prop>
2. PROPFIND
curl -XPROPFIND "https://localhost:9200/remote.php/dav/files/admin/file.txt" \
-d'<?xml version="1.0"?><d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns" xmlns:x1="http://whatever.org/ns"><d:prop><x1:very-custom-prop/></d:prop></d:propfind>' \
-u admin:admin -vk | xmllint --format -
Actual:
<d:prop>
<very-custom-prop xmlns="http://whatever.org/ns">
<foo xmlns="http://bar"/>
</very-custom-prop>
</d:prop>
Expected:
<d:prop>
<x1:very-custom-prop xmlns:x1="http://whatever.org/ns">
<x2:foo xmlns:x2="http://bar"/>
</x1:very-custom-prop>
</d:prop>
CC @micbar @ScharfViktor