Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect MIME/Content-Type for JavaScript on misconfigured Windows systems #4468

Merged
merged 2 commits into from Mar 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,10 +1619,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