Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5621:39dbe83643c0 | 5622:2a7d23a098ca |
|---|---|
| 206 | 206 |
| 207 @classmethod | 207 @classmethod |
| 208 def execute(cls, instance, path, method, input): | 208 def execute(cls, instance, path, method, input): |
| 209 # format the input | 209 # format the input |
| 210 path = path.strip('/').lower() | 210 path = path.strip('/').lower() |
| 211 if path == 'rest': | |
| 212 # allow handler to be called for /rest/ | |
| 213 path = 'rest/' | |
| 211 method = method.upper() | 214 method = method.upper() |
| 212 | 215 |
| 213 # find the rule match the path | 216 # find the rule match the path |
| 214 # then get handler match the method | 217 # then get handler match the method |
| 215 for path_regex in cls.__route_map: | 218 for path_regex in cls.__route_map: |
