Merge pull request #2069 from imachug/patch-1

Guess content type correctly
This commit is contained in:
ZeroNet 2019-07-04 11:34:01 +02:00 committed by GitHub
commit a252ec36f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,7 +174,7 @@ class UiRequest(object):
# Get mime by filename # Get mime by filename
def getContentType(self, file_name): def getContentType(self, file_name):
file_name = file_name.lower() file_name = file_name.lower()
ext = file_name.split(".", 1)[-1] ext = file_name.rsplit(".", 1)[-1]
if ext == "css": # Force correct css content type if ext == "css": # Force correct css content type
content_type = "text/css" content_type = "text/css"