Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set the content-length header for sendfile. Fixes #447

  • Loading branch information...
commit 3bec75d230507335eaf9066605d3893e185b9e11 1 parent de5038f
@mitsuhiko authored
Showing with 2 additions and 0 deletions.
  1. +1 −0  CHANGES
  2. +1 −0  flask/helpers.py
View
1  CHANGES
@@ -13,6 +13,7 @@ Release date to be decided.
:ref:`upgrading-to-010` for more information.
- Added ``template_test`` methods in addition to the already existing
``template_filter`` method family.
+- Set the content-length header for x-sendfile.
Version 0.9
-----------
View
1  flask/helpers.py
@@ -541,6 +541,7 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
if file is not None:
file.close()
headers['X-Sendfile'] = filename
+ headers['Content-Length'] = os.path.getsize(filename)
data = None
else:
if file is None:
Please sign in to comment.
Something went wrong with that request. Please try again.