strip '/' from paths in template-render handlers

This commit is contained in:
MinRK 2013-10-11 09:22:27 +02:00
parent 36aa39e3b7
commit d739a72638
2 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class NotebookHandler(IPythonHandler):
def get(self, path='', name=None):
"""get renders the notebook template if a name is given, or
redirects to the '/files/' handler if the name is not given."""
path = path.strip('/')
nbm = self.notebook_manager
if name is None:
raise web.HTTPError(500, "This shouldn't be accessible: %s" % self.request.uri)

View File

@ -32,6 +32,7 @@ class TreeHandler(IPythonHandler):
@web.authenticated
def get(self, path='', name=None):
path = path.strip('/')
nbm = self.notebook_manager
if name is not None:
# is a notebook, redirect to notebook handler