mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Get /files/ unmodified from contents
request raw files instead of parsing notebooks avoids reserializing (inconsistently) on download of notebooks.
This commit is contained in:
parent
c5f20e9481
commit
a4321ccf5a
@ -28,12 +28,12 @@ class FilesHandler(IPythonHandler):
|
||||
else:
|
||||
name = path
|
||||
|
||||
model = cm.get(path)
|
||||
model = cm.get(path, type='file')
|
||||
|
||||
if self.get_argument("download", False):
|
||||
self.set_header('Content-Disposition','attachment; filename="%s"' % name)
|
||||
|
||||
if model['type'] == 'notebook':
|
||||
if model['type'] == 'notebook' or name.endswith('.ipynb'):
|
||||
self.set_header('Content-Type', 'application/json')
|
||||
else:
|
||||
cur_mime = mimetypes.guess_type(name)[0]
|
||||
|
Loading…
Reference in New Issue
Block a user