UtrechtUniversity / davrods

An Apache WebDAV interface to iRODS
GNU Lesser General Public License v3.0
23 stars 12 forks source link

Paths in multistatus PROPFIND response document have double slash (//) #19

Open tedgin opened 4 years ago

tedgin commented 4 years ago

When a PROPFIND request is made on a collection with the URL https://host.domain/collection/, the paths to the members of /collection/ in the DAV:multistatus response document all have an extra forward slash in the URL immediately after the /collection/ prefix. For example, if object is a member of collection, its URL path in the response will be /collection//object. Here's a real example.

tedgin@dev ~? curl -u tedgin -H 'Depth: 1' -X PROPFIND https://data-dev.cyverse.rocks/dav/cyverse.dev/home/tedgin/IticketTest/
Enter host password for user 'tedgin':
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
<D:href>/dav/cyverse.dev/home/tedgin/IticketTest/</D:href>
<D:propstat>
<D:prop>
<D:creationdate>Wed, 30 Oct 2019 18:58:08 GMT</D:creationdate>
<D:getetag>"01572461888"</D:getetag>
<D:getlastmodified>Wed, 30 Oct 2019 18:58:08 GMT</D:getlastmodified>
<lp1:resourcetype><D:collection/></lp1:resourcetype>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
<D:href>/dav/cyverse.dev/home/tedgin/IticketTest//LICENSE.txt</D:href>
<D:propstat>
<D:prop>
<D:creationdate>Wed, 30 Oct 2019 18:58:24 GMT</D:creationdate>
<D:getcontentlength>3491</D:getcontentlength>
<D:getetag>"da3-01572461904"</D:getetag>
<D:getlastmodified>Wed, 30 Oct 2019 18:58:24 GMT</D:getlastmodified>
<lp1:resourcetype/>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
cjsmeele commented 4 years ago

Interesting, confirmed bug. Is this currently affecting/breaking a webdav client of yours? It seems the commonly used clients over the past years haven't been bothered by this. When/if clients end up sending follow-up requests with double slashes, they are currently normalized both by Apache and by iRODS path parsing to end up at the correct object.

tedgin commented 4 years ago

It's not causing any issues that I know of. I noticed it while debugging an unrelated issue we were having.

hurngchunlee commented 2 years ago

Hi, I just run into an issue when using rclone (https://rclone.org). It throws an error:

2022/03/11 08:38:42 ERROR : /Dockerfile: Entry doesn't belong in directory "" (contains subdir) - ignoring

due to this extra / in the returned path.

youngdjn commented 1 year ago

I just encountered this same error with rclone.