Allow non trailing slash API calls

This commit is contained in:
Ruud
2013-06-23 23:28:13 +02:00
parent 74c984dec3
commit 374f8ba1de
4 changed files with 11 additions and 20 deletions
+4 -2
View File
@@ -14,7 +14,8 @@ class NonBlockHandler(RequestHandler):
stoppers = []
@asynchronous
def get(self, route):
def get(self, route, *args, **kwargs):
route = route.strip('/')
start, stop = api_nonblock[route]
self.stoppers.append(stop)
@@ -43,7 +44,8 @@ def addNonBlockApiView(route, func_tuple, docs = None, **kwargs):
# Blocking API handler
class ApiHandler(RequestHandler):
def get(self, route):
def get(self, route, *args, **kwargs):
route = route.strip('/')
if not api.get(route):
self.write('API call doesn\'t seem to exist')
return