Guess content type correctly

Fix e.g. vue.min.js being reported as text/plain instead of text/javascript.
This commit is contained in:
Ivanq 2019-07-04 12:09:07 +03:00 committed by GitHub
parent 21f285e099
commit 33b478199a
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
def getContentType(self, file_name):
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
content_type = "text/css"