current-user-principal returns incorrect href. #23306

Closed
gvde opened this Issue Mar 16, 2016 · 4 comments

Projects

None yet

5 participants

@gvde
gvde commented Mar 16, 2016

Request the current user principal from carddav and it returns an incorrect href for the current user principal on owncloud 9:

$ curl  -u myself --data @propfind4.xml -H 'Depth: 0' -H 'Content-Type: application/xml; charset-utf-8' -X PROPFIND https://www.example.com/owncloud/remote.php/carddav/

with propfind4.xml:

<d:propfind xmlns:d="DAV:">
  <d:prop>
     <d:current-user-principal />
  </d:prop>
</d:propfind>

and after entering correct user password, returns:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav">
 <d:response>
  <d:href>/owncloud/remote.php/carddav/</d:href>
  <d:propstat>
   <d:prop>
    <d:current-user-principal>
     <d:href>/owncloud/remote.php/carddav/principals/users/myself/</d:href>
    </d:current-user-principal>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
</d:multistatus>

However, /owncloud/remote.php/carddav/principals/users/myself/ does not exist. The only principal uri that exists would be /owncloud/remote.php/carddav/principals/myself/

@PVince81
Collaborator

@DeepDiver1975 didn't you fix this already ? I remember seeing a PR that fixed hrefs

@DeepDiver1975 DeepDiver1975 added this to the 9.1-current milestone Mar 17, 2016
@DeepDiver1975 DeepDiver1975 self-assigned this Mar 17, 2016
@DeepDiver1975
Member

The LegacyDAVACL plugin is performing the transformation of principals - which is not necessary in this case 😢

@DeepDiver1975
Member

@gvde thanks a lot for this in depth testing - fix is available at #23342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment