[CalendarServer-changes] [15164] CalDAVClientLibrary/trunk/caldavclientlibrary/client/clientsession. py

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 5 09:03:26 PDT 2015


Revision: 15164
          http://trac.calendarserver.org//changeset/15164
Author:   cdaboo at apple.com
Date:     2015-10-05 09:03:26 -0700 (Mon, 05 Oct 2015)
Log Message:
-----------
Use .well-known to discover current principal if the specified root URL discovery fails.

Modified Paths:
--------------
    CalDAVClientLibrary/trunk/caldavclientlibrary/client/clientsession.py

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/client/clientsession.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/client/clientsession.py	2015-10-03 02:16:59 UTC (rev 15163)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/client/clientsession.py	2015-10-05 16:03:26 UTC (rev 15164)
@@ -94,10 +94,17 @@
         if current:
             self.principalPath = current
             return
+        current = self.getCurrentPrincipalResource(URL(url="/.well-known/caldav"))
+        if current:
+            self.principalPath = current
+            return
 
         hrefs = self.getHrefListProperty(self.rootPath, davxml.principal_collection_set)
         if not hrefs:
             return
+        hrefs = self.getHrefListProperty(URL(url="/.well-known/caldav"), davxml.principal_collection_set)
+        if not hrefs:
+            return
 
         # For each principal collection find current principal
         for href in hrefs:
@@ -278,8 +285,8 @@
                 # Get child element name (decode URL)
                 name = URL(url=item.getResource(), decode=True)
 
-                # Must match rurl
-                if name.equalRelative(rurl):
+                # Must match the URL the request was actually targeted at
+                if name.equalRelative(URL(url=request.url)):
 
                     if str(propname) in item.getNodeProperties():
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151005/9b40d723/attachment.html>


More information about the calendarserver-changes mailing list