Do not use Date, use Last-Modified. This fixes #164
This commit is contained in:
parent
94f90bc4eb
commit
0bf777ed81
2 changed files with 4 additions and 6 deletions
2
CHANGES
2
CHANGES
|
|
@ -33,6 +33,8 @@ Release date to be announced, codename to be selected
|
||||||
- Added an `endpoint` method to the flask application object which
|
- Added an `endpoint` method to the flask application object which
|
||||||
allows one to register a callback to an arbitrary endpoint with
|
allows one to register a callback to an arbitrary endpoint with
|
||||||
a decorator.
|
a decorator.
|
||||||
|
- Use Last-Modified for static file sending instead of Date which
|
||||||
|
was incorrectly introduced in 0.6.
|
||||||
|
|
||||||
Version 0.6.1
|
Version 0.6.1
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -364,13 +364,9 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
||||||
direct_passthrough=True)
|
direct_passthrough=True)
|
||||||
|
|
||||||
# if we know the file modification date, we can store it as the
|
# if we know the file modification date, we can store it as the
|
||||||
# current time to better support conditional requests. Werkzeug
|
# the time of the last modification.
|
||||||
# as of 0.6.1 will override this value however in the conditional
|
|
||||||
# response with the current time. This will be fixed in Werkzeug
|
|
||||||
# with a new release, however many WSGI servers will still emit
|
|
||||||
# a separate date header.
|
|
||||||
if mtime is not None:
|
if mtime is not None:
|
||||||
rv.date = int(mtime)
|
rv.last_modified = int(mtime)
|
||||||
|
|
||||||
rv.cache_control.public = True
|
rv.cache_control.public = True
|
||||||
if cache_timeout:
|
if cache_timeout:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue