From b193666c71a32550ce61a2a9a7bc722ef1b2a2fd Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Wed, 19 May 2021 11:34:04 +0530 Subject: [PATCH] fix: Do not set content type for paths ending with .com To avoid unnecessary download --- frappe/website/render.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/website/render.py b/frappe/website/render.py index 6a1d5a404e..c14d8e0d48 100644 --- a/frappe/website/render.py +++ b/frappe/website/render.py @@ -103,7 +103,9 @@ def set_content_type(response, data, path): response.mimetype = 'text/html' response.charset = 'utf-8' - if "." in path: + # ignore paths ending with .com to avoid unnecessary download + # https://bugs.python.org/issue22347 + if "." in path and not path.endswith('.com'): content_type, encoding = mimetypes.guess_type(path) if content_type: response.mimetype = content_type