File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1623,11 +1623,16 @@ def init_server_extensions(self):
16231623 exc_info = True )
16241624
16251625 def init_mime_overrides (self ):
1626- # On some Windows machines, an application has registered an incorrect
1627- # mimetype for CSS and JavaScript in the registry.
1626+ # On some Windows machines, an application has registered incorrect
1627+ # mimetypes in the registry.
16281628 # Tornado uses this when serving .css and .js files, causing browsers to
16291629 # reject these files. We know the mimetype always needs to be text/css for css
1630- # and application/javascript for JS, so we override it here.
1630+ # and application/javascript for JS, so we override it here
1631+ # and explicitly tell the mimetypes to not trust the Windows registry
1632+ if os .name == 'nt' :
1633+ # do not trust windows registry, which regularly has bad info
1634+ mimetypes .init (files = [])
1635+ # ensure css, js are correct, which are required for pages to function
16311636 mimetypes .add_type ('text/css' , '.css' )
16321637 mimetypes .add_type ('application/javascript' , '.js' )
16331638
You can’t perform that action at this time.
0 commit comments