[CalendarServer-changes] [2785] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Aug 7 16:27:00 PDT 2008
Revision: 2785
http://trac.macosforge.org/projects/calendarserver/changeset/2785
Author: wsanchez at apple.com
Date: 2008-08-07 16:26:59 -0700 (Thu, 07 Aug 2008)
Log Message:
-----------
Check request.path instead of request.uri for trailing / before redirect.
Modified Paths:
--------------
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.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 2008-08-07 18:24:42 UTC (rev 2784)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch 2008-08-07 23:26:59 UTC (rev 2785)
@@ -895,7 +895,7 @@
# HTTP
##
-@@ -1525,10 +1881,6 @@
+@@ -1525,15 +1881,11 @@
#litmus = request.headers.getRawHeaders("x-litmus")
#if litmus: log.msg("*** Litmus test: %s ***" % (litmus,))
@@ -906,6 +906,13 @@
#
# If this is a collection and the URI doesn't end in "/", redirect.
#
+- 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+'/'))
+
+ def setHeaders(response):
+ response = IResponse(response)
@@ -1567,7 +1919,7 @@
def findChildren(self, depth, request, callback, privileges=None, inherited_aces=None):
return succeed(None)
Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch 2008-08-07 18:24:42 UTC (rev 2784)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch 2008-08-07 23:26:59 UTC (rev 2785)
@@ -14,3 +14,12 @@
# Remove the dots from the path to split
self.defaultType = defaultType
self.ignoredExts = list(ignoredExts)
+@@ -383,7 +386,7 @@
+ return responsecode.NOT_FOUND
+
+ if self.fp.isdir():
+- if req.uri[-1] != "/":
++ if req.path[-1] != "/":
+ # Redirect to include trailing '/' in URI
+ return http.RedirectResponse(req.unparseURL(path=req.path+'/'))
+ else:
Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py 2008-08-07 18:24:42 UTC (rev 2784)
+++ CalendarServer/trunk/twistedcaldav/extensions.py 2008-08-07 23:26:59 UTC (rev 2785)
@@ -472,7 +472,7 @@
return responsecode.NOT_FOUND
if self.fp.isdir():
- if request.uri[-1] != "/":
+ if request.path[-1] != "/":
# Redirect to include trailing '/' in URI
return RedirectResponse(request.unparseURL(path=request.path+'/'))
else:
Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py 2008-08-07 18:24:42 UTC (rev 2784)
+++ CalendarServer/trunk/twistedcaldav/resource.py 2008-08-07 23:26:59 UTC (rev 2785)
@@ -130,7 +130,7 @@
if not renderAsHTML and self.isPseudoCalendarCollection():
# Render a monolithic iCalendar file
- if request.uri[-1] != "/":
+ if request.path[-1] != "/":
# Redirect to include trailing '/' in URI
return RedirectResponse(request.unparseURL(path=request.path+"/"))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080807/bb9834bc/attachment.html
More information about the calendarserver-changes
mailing list