fix: Do not set content type for paths ending with .com
To avoid unnecessary download
This commit is contained in:
parent
1be1c25e58
commit
b193666c71
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue