Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent de5038f · Browse files · 2 files+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−0 removed

  • other:+2 added−0 removed

2 files+2 added−0 removed

modified:flask/helpers.py+1 added
539 unmodified lines
540 if current_app.use_x_sendfile and filename:541 if file is not None:542 file.close()543 headers['X-Sendfile'] = filename544 headers['Content-Length'] = os.path.getsize(filename)545 data = None546 else:547 if file is None:548 file = open(filename, 'rb')
325 unmodified lines
modified:CHANGES+1 added
11 unmodified lines
12 limit the impact an attacker can do if the secret key leaks. See13 :ref:`upgrading-to-010` for more information.14- Added ``template_test`` methods in addition to the already existing15 ``template_filter`` method family.16- Set the content-length header for x-sendfile.1718Version 0.919-----------20
365 unmodified lines