Hash: SHA1

Tino Wildenhain wrote:

|>I had a client that used to work on 2.7.0, and now doesn't on 2.7.3.
|>The problem would appear to be that it's not substituting the
|>xmlrpc.Response class for a GET request on a text/xml content type and
|>therefore just delegating to the str() function instead of wrapping it
|>in the xml-rpc xml response tags.

| I wonder how this ever was supposed to work since
| XML-RPC requires an entidy body for the message (which is
| in XML). You can compare with RFC2616 - there is no
| entidy body in GET. Your client needs to use POST.
| I suspect then it should work.

Ok, I now more fully understand the subtlety of this explanation.

What happened here is that in cgi.py's FieldStorage class, since this is
a GET request, it completely ignores the CONTENT_TYPE environment and
sets the content-type header to x-www-form-urlencoded.

According to Dave Winer's spec at http://www.xmlrpc.com/spec, XML-RPC is
supposed to be HTTP-POST based, where this issue is fully resolved.

I have implemented this GET 'Extension' with this patch.

I appreciate that supporting 'unofficial' extensions to protocols is not
something we want to encourage, but is there any chance of getting this
patch into zope core (ever)?

Cheers, Alan
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

--- HTTPRequest.py	2004-10-13 11:22:32.212653472 +1000
+++ HTTPRequest.py.orig	2004-10-13 11:20:51.146017936 +1000
@@ -385,11 +385,9 @@
         if not hasattr(fs,'list') or fs.list is None:
             # Hm, maybe it's an XML-RPC
-            if ((fs.headers.has_key('content-type') and
-                 fs.headers['content-type'] == 'text/xml' and
-                 method == 'POST') or
-		(environ.get('CONTENT_TYPE','') == 'text/xml' and
-		 method == 'GET')):
+            if (fs.headers.has_key('content-type') and
+                fs.headers['content-type'] == 'text/xml' and
+                method == 'POST'):
                 # Ye haaa, XML-RPC!
                 global xmlrpc
                 if xmlrpc is None: import xmlrpc
Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to