Skip to content

Commit e30b6c9

Browse files
committed
Link /xmlrpc to docs if accessed with browser
1 parent 62de172 commit e30b6c9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Features:
4747
regression tests for Postgres but not currently for mysql.
4848
See http://www.postgresql.org/docs/9.1/static/transaction-iso.html
4949
(Ralf Schlatterbeck)
50+
- /xmlrpc endpoint now shows link to XML-RPC documentation if accessed
51+
through browser, without text/xml Content-Type (anatoly techtonik)
5052

5153
Fixed:
5254

roundup/cgi/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def main(self):
370370
""" Wrap the real main in a try/finally so we always close off the db.
371371
"""
372372
try:
373-
if self.env.get('CONTENT_TYPE') == 'text/xml' and self.path == 'xmlrpc':
373+
if self.path == 'xmlrpc':
374374
self.handle_xmlrpc()
375375
else:
376376
self.inner_main()
@@ -380,6 +380,11 @@ def main(self):
380380

381381

382382
def handle_xmlrpc(self):
383+
if self.env.get('CONTENT_TYPE') != 'text/xml':
384+
self.write("This is the endpoint of Roundup <a href='" +
385+
"http://www.roundup-tracker.org/docs/xmlrpc.html'>" +
386+
"XML-RPC interface</a>.")
387+
return
383388

384389
# Pull the raw XML out of the form. The "value" attribute
385390
# will be the raw content of the POST request.

0 commit comments

Comments
 (0)