Skip to content

Commit 0bf777e

Browse files
committed
Do not use Date, use Last-Modified. This fixes pallets#164
1 parent 94f90bc commit 0bf777e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Release date to be announced, codename to be selected
3333
- Added an `endpoint` method to the flask application object which
3434
allows one to register a callback to an arbitrary endpoint with
3535
a decorator.
36+
- Use Last-Modified for static file sending instead of Date which
37+
was incorrectly introduced in 0.6.
3638

3739
Version 0.6.1
3840
-------------

flask/helpers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,9 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
364364
direct_passthrough=True)
365365

366366
# if we know the file modification date, we can store it as the
367-
# current time to better support conditional requests. Werkzeug
368-
# as of 0.6.1 will override this value however in the conditional
369-
# response with the current time. This will be fixed in Werkzeug
370-
# with a new release, however many WSGI servers will still emit
371-
# a separate date header.
367+
# the time of the last modification.
372368
if mtime is not None:
373-
rv.date = int(mtime)
369+
rv.last_modified = int(mtime)
374370

375371
rv.cache_control.public = True
376372
if cache_timeout:

0 commit comments

Comments
 (0)