diff options
author | Santiago Gala <sgala@apache.org> | 2010-03-15 15:33:22 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2010-03-16 21:16:50 +0100 |
commit | 4995e0c3f442d02dd9ebc79c6d605ca004bd9ee7 (patch) | |
tree | 21e7479c278a3aee37393db252a3ed87b640c004 | |
parent | 83d5daab086112d09f2fb824a3bafa993c0ad162 (diff) | |
download | bottle-4995e0c3f442d02dd9ebc79c6d605ca004bd9ee7.tar.gz |
Round stats.st_mtime to seconds or it will fail with ext4
Not sure about other setups, but here (ext4)
stats.st_mtime is a float, whicle parse_date
return an integer, so it is almost impossible
that the recorded Last-Modified is greater or
equal than the st_mtime of the file. The patch
fixes it.
-rwxr-xr-x | bottle.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -957,7 +957,7 @@ def static_file(filename, root, guessmime=True, mimetype=None, download=False): if ims: ims = ims.split(";")[0].strip() # IE sends "<date>; length=146" ims = parse_date(ims) - if ims is not None and ims >= stats.st_mtime: + if ims is not None and ims >= int(stats.st_mtime): return HTTPResponse("Not modified", status=304, header=header) header['Content-Length'] = stats.st_size if request.method == 'HEAD': |