quixote util.py,1.2,1.3

Andrew Kuchling <akuchlin-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]>
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Update of /home/cvs/quixote
In directory hewson:/tmp/cvs-serv2525

Modified Files:
	util.py 
Log Message:
Return an HTTP 405 if not  using a POST; delete commented line

Index: util.py
===================================================================
RCS file: /home/cvs/quixote/util.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- util.py	9 Sep 2002 16:06:23 -0000	1.2
+++ util.py	16 Oct 2002 01:21:32 -0000	1.3
@@ -6,8 +6,6 @@
                           'func' with the method name and parameters.
 """
 
-# created 2002/03/29, AMK
-
 __revision__ = "$Id$"
 
 import sys, xmlrpclib
@@ -23,8 +21,8 @@
     # Get contents of POST body
     method = request.environ['REQUEST_METHOD'] 
     if method != 'POST':
-        raise RuntimeError, ('XML-RPC handler cannot accept HTTP request '
-                             'method %r' % method)
+        request.response.set_status(405, "Only the POST method is accepted")
+        return "XML-RPC handlers only accept the POST method."
     
     length = int(request.environ['CONTENT_LENGTH'])
     data = request.stdin.read(length)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.