diff roundup/cgi/client.py @ 4919:24209344b507

Link /xmlrpc to docs if accessed with browser
author anatoly techtonik <techtonik@gmail.com>
date Tue, 12 Aug 2014 00:46:17 +0300
parents 48d93e98be7b
children 91029cc0dc59 63c31b18b955
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sun Aug 03 12:52:41 2014 +0300
+++ b/roundup/cgi/client.py	Tue Aug 12 00:46:17 2014 +0300
@@ -370,7 +370,7 @@
         """ Wrap the real main in a try/finally so we always close off the db.
         """
         try:
-            if self.env.get('CONTENT_TYPE') == 'text/xml' and self.path == 'xmlrpc':
+            if self.path == 'xmlrpc':
                 self.handle_xmlrpc()
             else:
                 self.inner_main()
@@ -380,6 +380,11 @@
 
 
     def handle_xmlrpc(self):
+        if self.env.get('CONTENT_TYPE') != 'text/xml':
+            self.write("This is the endpoint of Roundup <a href='" +
+                "http://www.roundup-tracker.org/docs/xmlrpc.html'>" +
+                "XML-RPC interface</a>.")
+            return
 
         # Pull the raw XML out of the form.  The "value" attribute
         # will be the raw content of the POST request.

Roundup Issue Tracker: http://roundup-tracker.org/