forked from orbit-oss/flask
Don't fail for unicode filenames with send_file(add_etags=True)
This commit is contained in:
parent
e3f2dd8f08
commit
8017febac4
1 changed files with 4 additions and 1 deletions
|
|
@ -379,7 +379,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
||||||
rv.set_etag('flask-%s-%s-%s' % (
|
rv.set_etag('flask-%s-%s-%s' % (
|
||||||
os.path.getmtime(filename),
|
os.path.getmtime(filename),
|
||||||
os.path.getsize(filename),
|
os.path.getsize(filename),
|
||||||
adler32(filename) & 0xffffffff
|
adler32(
|
||||||
|
filename.encode('utf8') if isinstance(filename, unicode)
|
||||||
|
else filename
|
||||||
|
) & 0xffffffff
|
||||||
))
|
))
|
||||||
if conditional:
|
if conditional:
|
||||||
rv = rv.make_conditional(request)
|
rv = rv.make_conditional(request)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue