From 20cac8236d29352f4d0d323a401e39c03caf5353 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Fri, 18 Aug 2017 11:06:45 +0100 Subject: [PATCH] URL escape file path in iframe view handler Closes gh-2775 --- notebook/view/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/view/handlers.py b/notebook/view/handlers.py index 4496a5294..3e89faccc 100644 --- a/notebook/view/handlers.py +++ b/notebook/view/handlers.py @@ -17,7 +17,7 @@ class ViewHandler(IPythonHandler): raise web.HTTPError(404, u'File does not exist: %s' % path) basename = path.rsplit('/', 1)[-1] - file_url = url_path_join(self.base_url, 'files', path) + file_url = url_path_join(self.base_url, 'files', url_escape(path)) self.write( self.render_template('view.html', file_url=file_url, page_title=basename) )