[Twisted-Python] web.static patch waiting for commit (before 1.0.1)
Paul Boehm
typo at soniq.net
Wed Nov 13 12:35:06 MST 2002
the patch i submitted for pre-1.0 because to fix query_string's for
index.rpy's (see list archive), hasn't been commited nor rejected so far.
testcase is: http://www.twistedmatrix.com/, repeatedly adding ?bla=foo strings
and wondering about the redirect that discards the query_string.
anyone care to look at this?:
diff -u -r1.74 static.py
--- static.py 12 Nov 2002 13:00:06 -0000 1.74
+++ static.py 13 Nov 2002 19:31:41 -0000
@@ -267,10 +267,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