From 197e568828c10ebc8e172f1d469be918bf4543af Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 27 Mar 2019 14:09:13 +0100 Subject: [PATCH] Backport PR #4468: Fix incorrect MIME/Content-Type for JavaScript on misconfigured Windows systems --- notebook/notebookapp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 6b680ed9a4..0f4f85e528 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1581,10 +1581,12 @@ def init_server_extensions(self): def init_mime_overrides(self): # On some Windows machines, an application has registered an incorrect - # mimetype for CSS in the registry. Tornado uses this when serving - # .css files, causing browsers to reject the stylesheet. We know the - # mimetype always needs to be text/css, so we override it here. + # mimetype for CSS and JavaScript in the registry. + # Tornado uses this when serving .css and .js files, causing browsers to + # reject these files. We know the mimetype always needs to be text/css for css + # and application/javascript for JS, so we override it here. mimetypes.add_type('text/css', '.css') + mimetypes.add_type('application/javascript', '.js') def shutdown_no_activity(self):