[CalendarServer-changes] [4175] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue May 5 03:00:34 PDT 2009


Revision: 4175
          http://trac.macosforge.org/projects/calendarserver/changeset/4175
Author:   darla at apple.com
Date:     2009-05-05 03:00:33 -0700 (Tue, 05 May 2009)
Log Message:
-----------
Unescaping the path before escaping it.  That makes sure that the path ends up escaped only once, whether it was escaped or not to begin with.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
    CalendarServer/trunk/twistedcaldav/extensions.py
    CalendarServer/trunk/twistedcaldav/resource.py

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2009-05-05 03:32:58 UTC (rev 4174)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2009-05-05 10:00:33 UTC (rev 4175)
@@ -1084,7 +1084,7 @@
 -        if self.isCollection() and request.uri[-1:] != "/":
 -            return RedirectResponse(request.uri + "/")
 +        if self.isCollection() and request.path[-1:] != "/":
-+            return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
++            return RedirectResponse(request.unparseURL(path=urllib.quote(urllib.unquote(request.path), safe=':/')+'/'))
  
          def setHeaders(response):
              response = IResponse(response)

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2009-05-05 03:32:58 UTC (rev 4174)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2009-05-05 10:00:33 UTC (rev 4175)
@@ -763,7 +763,7 @@
         if self.fp.isdir():
             if request.path[-1] != "/":
                 # Redirect to include trailing '/' in URI
-                return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
+                return RedirectResponse(request.unparseURL(path=urllib.quote(urllib.unquote(request.path), safe=':/')+'/'))
             else:
                 ifp = self.fp.childSearchPreauth(*self.indexNames)
                 if ifp:

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2009-05-05 03:32:58 UTC (rev 4174)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2009-05-05 10:00:33 UTC (rev 4175)
@@ -144,7 +144,7 @@
             # Render a monolithic iCalendar file
             if request.path[-1] != "/":
                 # Redirect to include trailing '/' in URI
-                return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
+                return RedirectResponse(request.unparseURL(path=urllib.quote(urllib.unquote(request.path), safe=':/')+'/'))
 
             def _defer(data):
                 response = Response()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090505/51a6ec2a/attachment-0001.html>


More information about the calendarserver-changes mailing list