Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

PROPFIND does not return file size in drone #67

Closed
individual-it opened this issue Jan 30, 2020 · 7 comments · Fixed by owncloud/core#37344
Closed

PROPFIND does not return file size in drone #67

individual-it opened this issue Jan 30, 2020 · 7 comments · Fixed by owncloud/core#37344
Assignees

Comments

@individual-it
Copy link
Member

doing PROPFIND /remote.php/dav/files/oc/user0/test-file.txt wit data:

<?xml version="1.0"?>
				<d:propfind
				   xmlns:d="DAV:"
				   xmlns:oc="http://owncloud.org/ns"
				   xmlns:ocs="http://open-collaboration-services.org/ns"
				   >
				    <d:prop></d:prop>
				</d:propfind>

locally I receive



<?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/oc/user0/test-file.txt</d:href>
      <d:propstat>
         <d:prop>
            <oc:id>MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjU1NDQwMDAwOjI1YTFmNTg0LWU2MjgtNDZjZC04ZWVjLWYzZWJjNTQ1YWIxYQ==</oc:id>
            <oc:fileid>MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjU1NDQwMDAwOjI1YTFmNTg0LWU2MjgtNDZjZC04ZWVjLWYzZWJjNTQ1YWIxYQ==</oc:fileid>
            <d:getetag>"d6810f479ea04a590891a81f8edef518"</d:getetag>
            <oc:permissions>WCKDNVR</oc:permissions>
            <d:getcontenttype>text/plain; charset=utf-8</d:getcontenttype>
            <d:getcontentlength>19</d:getcontentlength>
            <d:getlastmodified>Thu, 30 Jan 2020 07:02:47 UTC</d:getlastmodified>
            <oc:favorite>0</oc:favorite>
         </d:prop>
         <d:status>HTTP/1.1 200 OK</d:status>
      </d:propstat>
   </d:response>
</d:multistatus>

but on drone



<?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/oc/user0/test-file.txt</d:href>
      <d:propstat>
         <d:prop>
            <oc:id>MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjU1NDQwMDAwOjU4MTRhZDdkLTMzZDUtNGE1Yi05OTY3LTc1MzRmNTY0MWE2NA==</oc:id>
            <oc:fileid>MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjU1NDQwMDAwOjU4MTRhZDdkLTMzZDUtNGE1Yi05OTY3LTc1MzRmNTY0MWE2NA==</oc:fileid>
            <d:getetag>"a00be2b04045160efc6517bdd54b816f"</d:getetag>
            <oc:permissions>WCKDNVR</oc:permissions>
            <d:getlastmodified>Thu, 30 Jan 2020 07:15:29 UTC</d:getlastmodified>
            <oc:favorite>0</oc:favorite>
         </d:prop>
         <d:status>HTTP/1.1 200 OK</d:status>
      </d:propstat>
   </d:response>
</d:multistatus>
@PVince81
Copy link
Contributor

maybe drone is using a different storage driver ?

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

I've raised #170 to run it on Drone so we can see if it still happens

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

seems not only "getcontentlength" is missing but also "getcontenttype"

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

here it looks like if no mime type is set then it also doesn't return the size: https://github.com/cs3org/reva/blob/master/internal/http/services/owncloud/ocdav/propfind.go#L249

now wondering if reva is using some OS level mime type detection which maybe is missing on Drone...

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

mime type detection is here: https://github.com/cs3org/reva/blob/master/pkg/mime/mime.go#L52

it's either using locally registered mime types (not sure how, maybe config) or relying on go's "mime" package for detection which itself relies on some system files for the extension mapping: https://golang.org/pkg/mime/#TypeByExtension

I suspect that maybe on Drone those files are not fully populated which might result in its inability to detect the mime type.

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

I've created a PR for the size issue: cs3org/reva#712

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

the fixes were merged in reva, need to update ocis-reva, will likely happen once #161 is updated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants