strip '/' from paths in template-render handlers

pull/37/head
MinRK 13 years ago
parent 36aa39e3b7
commit d739a72638

@ -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)

@ -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

Loading…
Cancel
Save