Fixed: uninitialized headers
This commit is contained in:
parent
70aa22ba51
commit
d8ed35a546
@ -168,6 +168,7 @@ async def file(location, mime_type=None, headers=None, force_download=False):
|
|||||||
out_stream = await _file.read()
|
out_stream = await _file.read()
|
||||||
# Do not attempt to render file in browser
|
# Do not attempt to render file in browser
|
||||||
if force_download is True:
|
if force_download is True:
|
||||||
|
headers = headers if headers is not None else {}
|
||||||
headers["Content-Disposition"] = "attachment; filename=%s" % filename
|
headers["Content-Disposition"] = "attachment; filename=%s" % filename
|
||||||
mime_type = 'application/octet-stream'
|
mime_type = 'application/octet-stream'
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user