Commit a51ff439 authored by 's avatar

Fixed If-Modified-Since handling

parent d47cff76
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Image object""" """Image object"""
__version__='$Revision: 1.96 $'[11:-2] __version__='$Revision: 1.97 $'[11:-2]
import Globals, string, struct, content_types import Globals, string, struct, content_types
from OFS.content_types import guess_content_type from OFS.content_types import guess_content_type
...@@ -194,8 +194,8 @@ class File(Persistent,Implicit,PropertyManager, ...@@ -194,8 +194,8 @@ class File(Persistent,Implicit,PropertyManager,
header=REQUEST.get_header('If-Modified-Since', None) header=REQUEST.get_header('If-Modified-Since', None)
if header is not None: if header is not None:
header=string.split(header, ';')[0] header=string.split(header, ';')[0]
mod_since=DateTime(header).timeTime() mod_since=int(DateTime(header).timeTime())
last_mod =self._p_mtime last_mod =int(self._p_mtime)
if last_mod > 0 and last_mod <= mod_since: if last_mod > 0 and last_mod <= mod_since:
RESPONSE.setStatus(304) RESPONSE.setStatus(304)
return RESPONSE return RESPONSE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment