[Twisted-Python] Problem with MovableType, XMLRPC, and CGI

Alex Levy mesozoic at polynode.com
Wed Oct 15 17:45:29 EDT 2003


I was trying to access the MovableType XML-RPC server (which uses Perl's
SOAP::Lite module), and kept getting Interal Server Errors. The problem,
as it turned out, was that the headers were separated from the response
by '\n\r\n', which wasn't recognized.

Is this a bug in Twisted, or in SOAP::Lite? I'm reluctant to add it to
the bug tracker without knowing whether this is actually a problem for
the Twisted team.

Below is the dirty nasty quick-fix I used:

--- twcgi.py.orig	Wed Oct 15 17:37:09 2003
+++ twcgi.py	Wed Oct 15 17:44:25 2003
@@ -208,7 +208,7 @@
         if self.handling_headers:
             text = self.headertext + output
             headerEnds = []
-            for delimiter in '\n\n','\r\n\r\n','\r\r':
+            for delimiter in '\n\n','\r\n\r\n','\r\r', '\n\r\n':
                 headerend = string.find(text,delimiter)
                 if headerend != -1:
                     headerEnds.append((headerend, delimiter))


-- 
Alex Levy
WWW: http://mesozoic.geecs.org

"Never let your sense of morals prevent you from doing what is right."
-- Salvor Hardin, Isaac Asimov's _Foundation_

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031015/d785c683/attachment.pgp 


More information about the Twisted-Python mailing list