forked from 0x2620/pandora
fix fallback
This commit is contained in:
parent
5512252570
commit
2eac09691b
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ def HttpFileResponse(path, content_type=None, filename=None):
|
||||||
response['Content-Type'] = content_type
|
response['Content-Type'] = content_type
|
||||||
response['Content-Length'] = os.stat(path).st_size
|
response['Content-Length'] = os.stat(path).st_size
|
||||||
else:
|
else:
|
||||||
response = HttpResponse(open(path), content_type=content_type)
|
response = HttpResponse(open(path, 'rb'), content_type=content_type)
|
||||||
if filename:
|
if filename:
|
||||||
if not isinstance(filename, bytes):
|
if not isinstance(filename, bytes):
|
||||||
filename = filename.encode('utf-8')
|
filename = filename.encode('utf-8')
|
||||||
|
|
Loading…
Reference in a new issue