From d739a72638b05af269fe625ee5ec90d93071906b Mon Sep 17 00:00:00 2001 From: MinRK Date: Fri, 11 Oct 2013 09:22:27 +0200 Subject: [PATCH] strip '/' from paths in template-render handlers --- IPython/html/notebook/handlers.py | 1 + IPython/html/tree/handlers.py | 1 + 2 files changed, 2 insertions(+) diff --git a/IPython/html/notebook/handlers.py b/IPython/html/notebook/handlers.py index 2f963ba77..2f7b3d4ab 100644 --- a/IPython/html/notebook/handlers.py +++ b/IPython/html/notebook/handlers.py @@ -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) diff --git a/IPython/html/tree/handlers.py b/IPython/html/tree/handlers.py index 6c6c56435..e2d854dd6 100644 --- a/IPython/html/tree/handlers.py +++ b/IPython/html/tree/handlers.py @@ -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