[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser - BrowserRequest.py:1.1.4.5

Jim Fulton jim@zope.com
Wed, 27 Mar 2002 14:34:22 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv3068

Modified Files:
      Tag: Zope-3x-branch
	BrowserRequest.py 
Log Message:
Changed to look up default objects on POST as well as GET, which some
people expect.


=== Zope3/lib/python/Zope/Publisher/Browser/BrowserRequest.py 1.1.4.4 => 1.1.4.5 ===
 EMPTY = 16
 CONVERTED = 32
+DEFAULTABLE_METHODS = 'GET', 'POST'
 
 search_type = re.compile('(:[a-zA-Z][a-zA-Z0-9_]+|\\.[xy])$').search
 
@@ -424,7 +425,7 @@
             # but we don't look for default documents any more.
             base_needed = 1
             redirect = 0
-        elif method == 'GET':
+        elif method in DEFAULTABLE_METHODS:
             # We need to check for default documents
             publication = self.getPublication()
             
@@ -440,7 +441,7 @@
 
             if nsteps > self._endswithslash:
                 base_needed = 1
-                redirect = self.use_redirect
+                redirect = self.use_redirect and method == 'GET'
 
 
         if base_needed: