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 @@ -1618,11 +1618,16 @@ def init_server_extensions(self):
16181618 exc_info = True )
16191619
16201620 def init_mime_overrides (self ):
1621- # On some Windows machines, an application has registered an incorrect
1622- # mimetype for CSS and JavaScript in the registry.
1621+ # On some Windows machines, an application has registered incorrect
1622+ # mimetypes in the registry.
16231623 # Tornado uses this when serving .css and .js files, causing browsers to
16241624 # 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.
1625+ # and application/javascript for JS, so we override it here
1626+ # and explicitly tell the mimetypes to not trust the Windows registry
1627+ if os .name == 'nt' :
1628+ # do not trust windows registry, which regularly has bad info
1629+ mimetypes .init (files = [])
1630+ # ensure css, js are correct, which are required for pages to function
16261631 mimetypes .add_type ('text/css' , '.css' )
16271632 mimetypes .add_type ('application/javascript' , '.js' )
16281633
You can’t perform that action at this time.
0 commit comments