diff roundup/rest.py @ 5622:2a7d23a098ca

Make @Routing.route('/') decoration work. This decoration matches 'rest/' (note trailing /). Make sure that a path reduced to "rest" is rewritten to "rest/" so we can handle the root of the rest tree.
author John Rouillard <rouilj@ieee.org>
date Sun, 24 Feb 2019 21:46:24 -0500
parents 39dbe83643c0
children 07abc8d36940
line wrap: on
line diff
--- a/roundup/rest.py	Sun Feb 24 21:42:25 2019 -0500
+++ b/roundup/rest.py	Sun Feb 24 21:46:24 2019 -0500
@@ -208,6 +208,9 @@
     def execute(cls, instance, path, method, input):
         # format the input
         path = path.strip('/').lower()
+        if path == 'rest':
+            # allow handler to be called for /rest/
+            path = 'rest/'
         method = method.upper()
 
         # find the rule match the path

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