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