Do not error for unknown files if send_file sends an actual file

This commit is contained in:
Armin Ronacher 2016-09-10 03:33:53 +03:00
parent c54c538c11
commit a30951ec28
2 changed files with 3 additions and 4 deletions

View file

@ -513,7 +513,8 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
if mimetype is None:
if attachment_filename is not None:
mimetype = mimetypes.guess_type(attachment_filename)[0]
mimetype = mimetypes.guess_type(attachment_filename)[0] \
or 'application/octet-stream'
if mimetype is None:
if attachment_filename is not None: