##// END OF EJS Templates
Merge pull request #4715 from minrk/tornado-static-url...
Min RK -
r13985:0fc2a30e merge
parent child Browse files
Show More
@@ -193,8 +193,9 b' class IPythonHandler(AuthenticatedHandler):'
193 logged_in=self.logged_in,
193 logged_in=self.logged_in,
194 login_available=self.login_available,
194 login_available=self.login_available,
195 use_less=self.use_less,
195 use_less=self.use_less,
196 static_url=self.static_url,
196 )
197 )
197
198
198 def get_json_body(self):
199 def get_json_body(self):
199 """Return the body of the request as JSON data."""
200 """Return the body of the request as JSON data."""
200 if not self.request.body:
201 if not self.request.body:
@@ -329,13 +330,16 b' class FileFindHandler(web.StaticFileHandler):'
329 abspath = os.path.abspath(filefind(path, roots))
330 abspath = os.path.abspath(filefind(path, roots))
330 except IOError:
331 except IOError:
331 # IOError means not found
332 # IOError means not found
332 raise web.HTTPError(404)
333 return ''
333
334
334 cls._static_paths[path] = abspath
335 cls._static_paths[path] = abspath
335 return abspath
336 return abspath
336
337
337 def validate_absolute_path(self, root, absolute_path):
338 def validate_absolute_path(self, root, absolute_path):
338 """check if the file should be served (raises 404, 403, etc.)"""
339 """check if the file should be served (raises 404, 403, etc.)"""
340 if absolute_path == '':
341 raise web.HTTPError(404)
342
339 for root in self.root:
343 for root in self.root:
340 if (absolute_path + os.sep).startswith(root):
344 if (absolute_path + os.sep).startswith(root):
341 break
345 break
@@ -1,9 +1,6 b''
1
1
2
2
3 <!DOCTYPE HTML>
3 <!DOCTYPE HTML>
4 {% macro static_url(name) -%}
5 {{ base_project_url }}static/{{ name }}
6 {%- endmacro %}
7 <html>
4 <html>
8
5
9 <head>
6 <head>
@@ -28,7 +25,7 b''
28 <script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
25 <script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
29 <script>
26 <script>
30 require.config({
27 require.config({
31 baseUrl: '{{static_url()}}',
28 baseUrl: '{{static_url("")}}',
32 paths: {
29 paths: {
33 nbextensions : '{{ base_project_url }}nbextensions'
30 nbextensions : '{{ base_project_url }}nbextensions'
34 }
31 }
General Comments 0
You need to be logged in to leave comments. Login now