mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Merge pull request #8005 from minrk/files-as-file
Get /files/ unmodified from contents
This commit is contained in:
commit
cf6925ce7a
@ -28,12 +28,13 @@ 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':
|
||||
# get mimetype from filename
|
||||
if 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