[Checkins] SVN: zope.publisher/branches/3.4/ Backported fix for bug 172742

Christian Theune ct at gocept.com
Fri Dec 7 10:03:16 EST 2007


Log message for revision 82179:
  Backported fix for bug 172742
  

Changed:
  A   zope.publisher/branches/3.4/CHANGES.txt
  U   zope.publisher/branches/3.4/src/zope/publisher/base.py
  U   zope.publisher/branches/3.4/src/zope/publisher/tests/test_http.py

-=-
Added: zope.publisher/branches/3.4/CHANGES.txt
===================================================================
--- zope.publisher/branches/3.4/CHANGES.txt	                        (rev 0)
+++ zope.publisher/branches/3.4/CHANGES.txt	2007-12-07 15:03:15 UTC (rev 82179)
@@ -0,0 +1,15 @@
+=======
+CHANGES
+=======
+
+3.4.2 (unreleased)
+------------------
+
+- Made segmentation of URLs not strip (trailing) whitespace from path segments
+  to allow URLs ending in %20 to be handled correctly. (#172742)
+
+
+Before 3.4.2
+------------
+
+No changes were tracked.


Property changes on: zope.publisher/branches/3.4/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: zope.publisher/branches/3.4/src/zope/publisher/base.py
===================================================================
--- zope.publisher/branches/3.4/src/zope/publisher/base.py	2007-12-07 14:51:08 UTC (rev 82178)
+++ zope.publisher/branches/3.4/src/zope/publisher/base.py	2007-12-07 15:03:15 UTC (rev 82179)
@@ -366,7 +366,7 @@
         return "\n".join(map(lambda item: "%s:\t%s" % item, L1))
 
     def _setupPath_helper(self, attr):
-        path = self.get(attr, "/").strip()
+        path = self.get(attr, "/")
         if path.endswith('/'):
             # Remove trailing backslash, so that we will not get an empty
             # last entry when splitting the path.

Modified: zope.publisher/branches/3.4/src/zope/publisher/tests/test_http.py
===================================================================
--- zope.publisher/branches/3.4/src/zope/publisher/tests/test_http.py	2007-12-07 14:51:08 UTC (rev 82178)
+++ zope.publisher/branches/3.4/src/zope/publisher/tests/test_http.py	2007-12-07 15:03:15 UTC (rev 82179)
@@ -524,6 +524,11 @@
                           'some output',
                           )
 
+    def test_PathTrailingWhitespace(self):
+        request = self._createRequest({'PATH_INFO': '/test '})
+        self.assertEqual(['test '], request.getTraversalStack())
+
+
 class ConcreteHTTPTests(HTTPTests):
     """Tests that we don't have to worry about subclasses inheriting and
     breaking.
@@ -762,7 +767,6 @@
         self.assertEqual(request.traverse(app).name, 'Engineering')
         self.assertEqual(request._last_obj_traversed, app.ZopeCorp.Engineering)
 
-
 def cleanUp(test):
     zope.testing.cleanup.cleanUp()
 



More information about the Checkins mailing list