##// END OF EJS Templates
rethrow upstream HTTP errors...
Min RK -
Show More
@@ -1,16 +1,9 b''
1 """PostProcessor for serving reveal.js HTML slideshows."""
1 """PostProcessor for serving reveal.js HTML slideshows."""
2 from __future__ import print_function
2
3 #-----------------------------------------------------------------------------
3 # Copyright (c) IPython Development Team.
4 #Copyright (c) 2013, the IPython Development Team.
5 #
6 #Distributed under the terms of the Modified BSD License.
4 # Distributed under the terms of the Modified BSD License.
7 #
8 #The full license is in the file COPYING.txt, distributed with this software.
9 #-----------------------------------------------------------------------------
10
5
11 #-----------------------------------------------------------------------------
6 from __future__ import print_function
12 # Imports
13 #-----------------------------------------------------------------------------
14
7
15 import os
8 import os
16 import webbrowser
9 import webbrowser
@@ -22,9 +15,6 b' from IPython.utils.traitlets import Bool, Unicode, Int'
22
15
23 from .base import PostProcessorBase
16 from .base import PostProcessorBase
24
17
25 #-----------------------------------------------------------------------------
26 # Classes
27 #-----------------------------------------------------------------------------
28
18
29 class ProxyHandler(web.RequestHandler):
19 class ProxyHandler(web.RequestHandler):
30 """handler the proxies requests from a local prefix to a CDN"""
20 """handler the proxies requests from a local prefix to a CDN"""
@@ -37,12 +27,15 b' class ProxyHandler(web.RequestHandler):'
37
27
38 def finish_get(self, response):
28 def finish_get(self, response):
39 """finish the request"""
29 """finish the request"""
40 # copy potentially relevant headers
30 # rethrow errors
31 response.rethrow()
32
41 for header in ["Content-Type", "Cache-Control", "Date", "Last-Modified", "Expires"]:
33 for header in ["Content-Type", "Cache-Control", "Date", "Last-Modified", "Expires"]:
42 if header in response.headers:
34 if header in response.headers:
43 self.set_header(header, response.headers[header])
35 self.set_header(header, response.headers[header])
44 self.finish(response.body)
36 self.finish(response.body)
45
37
38
46 class ServePostProcessor(PostProcessorBase):
39 class ServePostProcessor(PostProcessorBase):
47 """Post processor designed to serve files
40 """Post processor designed to serve files
48
41
General Comments 0
You need to be logged in to leave comments. Login now