[Twisted-Python] twisted.web

Paul Boehm typo at soniq.net
Fri Oct 4 10:58:20 MDT 2002


On Fri, Oct 04, 2002 at 06:21:23PM +0200, Paul Boehm wrote:
> ah, and another problem with that redirect might
> occur with woven Controller based index.rpy. 
> i'm not sure how to fix that.

forget my last patch, this should work:

diff -u -r1.63 static.py
--- static.py   1 Oct 2002 17:28:46 -0000       1.63
+++ static.py   4 Oct 2002 16:58:34 -0000
@@ -253,10 +253,12 @@
             # If someone is looking for children with a PathReferenceContext,
             # the request won't have a prepath, and we shouldn't do this kind
             # of mangling anyway because it has already been done.
-            if hasattr(request, 'postpath') and not request.postpath and request.uri[-1] != '/':
+            if hasattr(request, 'postpath') and not request.postpath and \
+                        string.split(request.uri,'?')[0][-1] != '/':
                 return Redirect(request)
             if os.path.exists(childPath):
-                if hasattr(request, 'postpath') and not request.postpath and not self.getIndex(request):
+                if hasattr(request, 'postpath') and not request.postpath and \
+                                                not self.getIndex(request):
                     return widgets.WidgetPage(DirectoryListing(self.path))





More information about the Twisted-Python mailing list