[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - BaseRequest.py:1.50 HTTPRequest.py:1.81

Martijn Pieters mj@zope.com
Thu, 29 Aug 2002 15:35:02 -0400


Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv6664/lib/python/ZPublisher

Modified Files:
	BaseRequest.py HTTPRequest.py 
Log Message:
XML-RPC requests would cause REQUEST_METHOD to be cleared to avoid searching
for 'index_html' default views. This breaks things like Cookie Crumbler. And
yes, when you use a JavaScript XML-RPC library, the browser could include an
authentication cookie for CookieCrumbler.

Instead, do not clear REQUEST_METHOD but check for a xmlrpc.Response object
when initiating the variable that will cause 'index_html' views to be used.

This fixes Zope Collector issue #528.


=== Zope/lib/python/ZPublisher/BaseRequest.py 1.49 => 1.50 ===
--- Zope/lib/python/ZPublisher/BaseRequest.py:1.49	Wed Aug 14 18:09:39 2002
+++ Zope/lib/python/ZPublisher/BaseRequest.py	Thu Aug 29 15:35:00 2002
@@ -13,6 +13,7 @@
 __version__='$Revision$'[11:-2]
 
 from urllib import quote
+import xmlrpc
 
 UNSPECIFIED_ROLES=''
 
@@ -196,7 +197,8 @@
         # How did this request come in? (HTTP GET, PUT, POST, etc.)
         method=req_method=request_get('REQUEST_METHOD', 'GET').upper()
 
-        if method=='GET' or method=='POST':
+        if method=='GET' or method=='POST' and not isinstance(response,
+                                                              xmlrpc.Response):
             # Probably a browser
             no_acquire_flag=0
             # index_html is still the default method, only any object can


=== Zope/lib/python/ZPublisher/HTTPRequest.py 1.80 => 1.81 ===
--- Zope/lib/python/ZPublisher/HTTPRequest.py:1.80	Tue Aug 20 23:09:31 2002
+++ Zope/lib/python/ZPublisher/HTTPRequest.py	Thu Aug 29 15:35:00 2002
@@ -373,7 +373,6 @@
                 meth, self.args = xmlrpc.parse_input(fs.value)
                 response=xmlrpc.response(response)
                 other['RESPONSE']=self.response=response
-                other['REQUEST_METHOD']='' # We don't want index_html!
                 self.maybe_webdav_client = 0
             else:
                 self._file=fs.file