Skip to content

Commit 7a13d5c

Browse files
authored
Merge pull request #4468 from ciaranlangton/master
Fix incorrect MIME/Content-Type for JavaScript
2 parents 1e8c90f + d8730ce commit 7a13d5c

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
@@ -1619,10 +1619,12 @@ def init_server_extensions(self):
16191619

16201620
def init_mime_overrides(self):
16211621
# On some Windows machines, an application has registered an incorrect
1622-
# mimetype for CSS in the registry. Tornado uses this when serving
1623-
# .css files, causing browsers to reject the stylesheet. We know the
1624-
# mimetype always needs to be text/css, so we override it here.
1622+
# mimetype for CSS and JavaScript in the registry.
1623+
# Tornado uses this when serving .css and .js files, causing browsers to
1624+
# reject these files. We know the mimetype always needs to be text/css for css
1625+
# and application/javascript for JS, so we override it here.
16251626
mimetypes.add_type('text/css', '.css')
1627+
mimetypes.add_type('application/javascript', '.js')
16261628

16271629

16281630
def shutdown_no_activity(self):

0 commit comments

Comments
 (0)