Add utf-8 charset header to more types
This commit is contained in:
parent
24ba2a150b
commit
cb4a4bd707
1 changed files with 2 additions and 4 deletions
|
@ -292,10 +292,8 @@ class UiRequest(object):
|
|||
headers["Access-Control-Allow-Headers"] = "Origin, X-Requested-With, Content-Type, Accept, Cookie, Range"
|
||||
headers["Access-Control-Allow-Credentials"] = "true"
|
||||
|
||||
if content_type == "text/html":
|
||||
content_type = "text/html; charset=utf-8"
|
||||
if content_type == "text/plain":
|
||||
content_type = "text/plain; charset=utf-8"
|
||||
if content_type in ("text/plain", "text/html", "text/css", "application/javascript", "application/json", "application/manifest+json"):
|
||||
content_type += "; charset=utf-8"
|
||||
|
||||
# Download instead of display file types that can be dangerous
|
||||
if re.findall("/svg|/xml|/x-shockwave-flash|/pdf", content_type):
|
||||
|
|
Loading…
Reference in a new issue