fix: not able to download XML file

This commit is contained in:
Rohit Waghchaure 2019-12-07 12:50:23 +05:30
parent 2743863407
commit 80f87a37fb

View file

@ -210,7 +210,7 @@ def send_private_file(path):
blacklist = ['.svg', '.html', '.htm', '.xml']
if extension.lower() in blacklist:
response.headers.add(b'Content-Disposition', b'attachment', filename=filename.encode("utf-8"))
response.headers.add('Content-Disposition', 'attachment', filename=filename.encode("utf-8"))
response.mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'