Rev1799, Force correct css content type

This commit is contained in:
shortcutme 2017-01-05 02:33:33 +01:00
parent 9d5bfa4be8
commit 5c2b90c20f
2 changed files with 5 additions and 1 deletions

View file

@ -9,7 +9,7 @@ class Config(object):
def __init__(self, argv): def __init__(self, argv):
self.version = "0.5.1" self.version = "0.5.1"
self.rev = 1797 self.rev = 1799
self.argv = argv self.argv = argv
self.action = None self.action = None
self.config_file = "zeronet.conf" self.config_file = "zeronet.conf"

View file

@ -99,6 +99,10 @@ class UiRequest(object):
# Get mime by filename # Get mime by filename
def getContentType(self, file_name): def getContentType(self, file_name):
content_type = mimetypes.guess_type(file_name)[0] content_type = mimetypes.guess_type(file_name)[0]
if file_name.endswith("css"): # Force correct css content type
content_type = "text/css"
if not content_type: if not content_type:
if file_name.endswith("json"): # Correct json header if file_name.endswith("json"): # Correct json header
content_type = "application/json" content_type = "application/json"