diff options
| author | Ian Bicking <ian@ianbicking.org> | 2006-08-28 17:03:07 +0000 |
|---|---|---|
| committer | Ian Bicking <ian@ianbicking.org> | 2006-08-28 17:03:07 +0000 |
| commit | 12bf1a2900a6086b30c253fdaa9607bb1af23a9a (patch) | |
| tree | 67cd642ddfff4fb0fd6509e2f46a5136780af321 | |
| parent | 149386cbdc35ba04e5c4ef1ae155099a0b4dd88b (diff) | |
| download | paste-git-12bf1a2900a6086b30c253fdaa9607bb1af23a9a.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).
| -rw-r--r-- | paste/fileapp.py | 5 |
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(): |
