Skip to content

Commit 197e568

Browse files
minrkMeeseeksDev[bot]
authored andcommitted
Backport PR jupyter#4468: Fix incorrect MIME/Content-Type for JavaScript on misconfigured Windows systems
1 parent 05aa4b2 commit 197e568

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

notebook/notebookapp.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,10 +1581,12 @@ def init_server_extensions(self):
15811581

15821582
def init_mime_overrides(self):
15831583
# On some Windows machines, an application has registered an incorrect
1584-
# mimetype for CSS in the registry. Tornado uses this when serving
1585-
# .css files, causing browsers to reject the stylesheet. We know the
1586-
# mimetype always needs to be text/css, so we override it here.
1584+
# mimetype for CSS and JavaScript in the registry.
1585+
# Tornado uses this when serving .css and .js files, causing browsers to
1586+
# reject these files. We know the mimetype always needs to be text/css for css
1587+
# and application/javascript for JS, so we override it here.
15871588
mimetypes.add_type('text/css', '.css')
1589+
mimetypes.add_type('application/javascript', '.js')
15881590

15891591

15901592
def shutdown_no_activity(self):

0 commit comments

Comments
 (0)