Explicitly set the mime-types so that a corrupted windows registry will not affect pgAdmin 4 to be load properly.

pull/37/head
Akshay Joshi 2020-11-23 11:46:09 +05:30
parent ce14696165
commit a2f4628590
1 changed files with 7 additions and 0 deletions

View File

@ -44,6 +44,13 @@ from pgadmin.utils.csrf import pgCSRFProtect
from pgadmin import authenticate
from pgadmin.utils.security_headers import SecurityHeaders
# Explicitly set the mime-types so that a corrupted windows registry will not
# affect pgAdmin 4 to be load properly. This will avoid the issues that may
# occur due to security fix of X_CONTENT_TYPE_OPTIONS = "nosniff".
import mimetypes
mimetypes.add_type('text/javascript', '.js')
mimetypes.add_type('text/css', '.css')
winreg = None
if os.name == 'nt':
import winreg