mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
strip '/' from paths in template-render handlers
This commit is contained in:
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…
Reference in New Issue
Block a user