From 0bf777ed81d5296fb722931d35e5db4333e3de39 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 5 Feb 2011 17:41:02 +0100 Subject: [PATCH] Do not use Date, use Last-Modified. This fixes #164 --- CHANGES | 2 ++ flask/helpers.py | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index b718d2fd..2ca6e355 100644 --- a/CHANGES +++ b/CHANGES @@ -33,6 +33,8 @@ Release date to be announced, codename to be selected - Added an `endpoint` method to the flask application object which allows one to register a callback to an arbitrary endpoint with a decorator. +- Use Last-Modified for static file sending instead of Date which + was incorrectly introduced in 0.6. Version 0.6.1 ------------- diff --git a/flask/helpers.py b/flask/helpers.py index eb12eee6..ed8a5d5c 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -364,13 +364,9 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False, direct_passthrough=True) # if we know the file modification date, we can store it as the - # current time to better support conditional requests. Werkzeug - # 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. + # the time of the last modification. if mtime is not None: - rv.date = int(mtime) + rv.last_modified = int(mtime) rv.cache_control.public = True if cache_timeout: