Fix extension detection

This commit is contained in:
MuxZeroNet 2017-01-12 05:22:26 +00:00 committed by GitHub
parent c20efea1e9
commit 6b0ef500ed

View file

@ -106,11 +106,11 @@ class UiRequest(object):
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 if file_name.endswith(".css"): # Force correct css content type
content_type = "text/css" 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"
else: else:
content_type = "application/octet-stream" content_type = "application/octet-stream"