From 0aedb2429689aa7ed26457926c8ab2256543f095 2015-03-09 16:40:15 From: Min RK Date: 2015-03-09 16:40:15 Subject: [PATCH] Get /files/ unmodified from contents request raw files instead of parsing notebooks avoids reserializing (inconsistently) on download of notebooks. --- diff --git a/IPython/html/files/handlers.py b/IPython/html/files/handlers.py index e78374e..17c222d 100644 --- a/IPython/html/files/handlers.py +++ b/IPython/html/files/handlers.py @@ -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]