Skip to content

Commit

Permalink
Merge pull request #4521 from meeseeksmachine/auto-backport-of-pr-446…
Browse files Browse the repository at this point in the history
…8-on-5.7.x

Backport PR #4468 on branch 5.7.x (Fix incorrect MIME/Content-Type for JavaScript on misconfigured Windows systems)
  • Loading branch information
minrk authored Mar 27, 2019
2 parents 05aa4b2 + 197e568 commit deb4d4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit deb4d4a

Please sign in to comment.