[CalendarServer-changes] [4024] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 16 02:49:26 PDT 2009


Revision: 4024
          http://trac.macosforge.org/projects/calendarserver/changeset/4024
Author:   darla at apple.com
Date:     2009-04-16 02:49:26 -0700 (Thu, 16 Apr 2009)
Log Message:
-----------
Encoding the URI in the Location header of the redirect response.

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-04-16 03:51:25 UTC (rev 4023)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2009-04-16 09:49:26 UTC (rev 4024)
@@ -2,7 +2,7 @@
 ===================================================================
 --- twisted/web2/dav/resource.py	(revision 19773)
 +++ twisted/web2/dav/resource.py	(working copy)
-@@ -31,20 +31,30 @@
+@@ -31,20 +31,31 @@
      "DAVResource",
      "DAVLeafResource",
      "DAVPrincipalResource",
@@ -18,7 +18,7 @@
      "unauthenticatedPrincipal",
  ]
  
--import urllib
+ import urllib
 +import __builtin__
 +if not hasattr(__builtin__, "set"):
 +    import sets.Set as set
@@ -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=request.path+'/'))
++            return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
  
          def setHeaders(response):
              response = IResponse(response)

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2009-04-16 03:51:25 UTC (rev 4023)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2009-04-16 09:49:26 UTC (rev 4024)
@@ -758,7 +758,7 @@
         if self.fp.isdir():
             if request.path[-1] != "/":
                 # Redirect to include trailing '/' in URI
-                return RedirectResponse(request.unparseURL(path=request.path+'/'))
+                return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
             else:
                 ifp = self.fp.childSearchPreauth(*self.indexNames)
                 if ifp:

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2009-04-16 03:51:25 UTC (rev 4023)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2009-04-16 09:49:26 UTC (rev 4024)
@@ -27,6 +27,8 @@
     "isPseudoCalendarCollectionResource",
 ]
 
+import urllib
+
 from zope.interface import implements
 
 from twisted.internet import reactor
@@ -140,7 +142,7 @@
             # Render a monolithic iCalendar file
             if request.path[-1] != "/":
                 # Redirect to include trailing '/' in URI
-                return RedirectResponse(request.unparseURL(path=request.path+"/"))
+                return RedirectResponse(request.unparseURL(path=urllib.quote(request.path, safe=':/')+'/'))
 
             def _defer(data):
                 response = Response()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090416/e03dc919/attachment.html>


More information about the calendarserver-changes mailing list