##// END OF EJS Templates
url_escape redirects
MinRK -
Show More
@@ -67,6 +67,8 b' class NotebookRedirectHandler(IPythonHandler):'
67 67 # otherwise, redirect to /files
68 68 # TODO: This should check if it's actually a file
69 69 url = url_path_join(self.base_project_url, 'files', path)
70 url = url_escape(url)
71 self.log.debug("Redirecting %s to %s", self.request.path, url)
70 72 self.redirect(url)
71 73
72 74 #-----------------------------------------------------------------------------
@@ -19,7 +19,7 b' import os'
19 19
20 20 from tornado import web
21 21 from ..base.handlers import IPythonHandler
22 from ..utils import url_path_join, path2url, url2path
22 from ..utils import url_path_join, path2url, url2path, url_escape
23 23 from ..services.notebooks.handlers import _notebook_path_regex, _path_regex
24 24
25 25 #-----------------------------------------------------------------------------
@@ -36,7 +36,10 b' class TreeHandler(IPythonHandler):'
36 36 nbm = self.notebook_manager
37 37 if name is not None:
38 38 # is a notebook, redirect to notebook handler
39 url = url_path_join(self.base_project_url, 'notebooks', path, name)
39 url = url_escape(url_path_join(
40 self.base_project_url, 'notebooks', path, name
41 ))
42 self.log.debug("Redirecting %s to %s", self.request.path, url)
40 43 self.redirect(url)
41 44 else:
42 45 if not nbm.path_exists(path=path):
@@ -54,8 +57,10 b' class TreeRedirectHandler(IPythonHandler):'
54 57
55 58 @web.authenticated
56 59 def get(self, path=''):
57 url = url_path_join(self.base_project_url, 'tree', path).rstrip('/')
58 self.log.debug("Redirecting %s to %s", self.request.uri, url)
60 url = url_escape(url_path_join(
61 self.base_project_url, 'tree', path.strip('/')
62 ))
63 self.log.debug("Redirecting %s to %s", self.request.path, url)
59 64 self.redirect(url)
60 65
61 66
General Comments 0
You need to be logged in to leave comments. Login now