mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-23 12:49:41 +08:00
Merge pull request #228 from minrk/nbconvert-files
fix files redirect in nbconvert handlers
This commit is contained in:
commit
406a57d70d
@ -85,7 +85,8 @@ class NbconvertFileHandler(IPythonHandler):
|
||||
model = self.contents_manager.get(path=path)
|
||||
name = model['name']
|
||||
if model['type'] != 'notebook':
|
||||
raise web.HTTPError(400, "Not a notebook: %s" % path)
|
||||
# not a notebook, redirect to files
|
||||
return FilesRedirectHandler.redirect_to_files(self, path)
|
||||
|
||||
self.set_header('Last-Modified', model['last_modified'])
|
||||
|
||||
@ -157,5 +158,4 @@ default_handlers = [
|
||||
(r"/nbconvert/%s" % _format_regex, NbconvertPostHandler),
|
||||
(r"/nbconvert/%s%s" % (_format_regex, path_regex),
|
||||
NbconvertFileHandler),
|
||||
(r"/nbconvert/html%s" % path_regex, FilesRedirectHandler),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user