summaryrefslogtreecommitdiff
path: root/paste/fileapp.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-08-28 17:03:07 +0000
committerianb <devnull@localhost>2006-08-28 17:03:07 +0000
commitb8893e19b94186bc1c7f0e977d9060696d101e7e (patch)
tree67cd642ddfff4fb0fd6509e2f46a5136780af321 /paste/fileapp.py
parent003b2349cce5d08dcc25cc6426037535a782ce9f (diff)
downloadpaste-b8893e19b94186bc1c7f0e977d9060696d101e7e.tar.gz
Set Last-Modified properly in paste.fileapp (it wasn't being updated properly when under CACHE_SIZE, and wasn't being updated at all when over CACHE_SIZE).
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r--paste/fileapp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py
index 2a8ef35..5d72008 100644
--- a/paste/fileapp.py
+++ b/paste/fileapp.py
@@ -161,6 +161,7 @@ class FileApp(DataApp):
stat = os.stat(self.filename)
if not force and stat.st_mtime == self.last_modified:
return
+ self.last_modified = stat.st_mtime
if stat.st_size < CACHE_SIZE:
fh = open(self.filename,"rb")
self.set_content(fh.read())
@@ -168,7 +169,9 @@ class FileApp(DataApp):
else:
self.content = None
self.content_length = stat.st_size
- self.last_modified = stat.st_mtime
+ # This is updated automatically if self.set_content() is
+ # called
+ LAST_MODIFIED.update(self.headers, time=self.last_modified)
def __call__(self, environ, start_response):
if 'max-age=0' in CACHE_CONTROL(environ).lower():