Commit 1959e19a authored by 's avatar

Added code to handle If-Modifed-Since headers sent by NS clients, which

appear to contain things other than rfc1123 dates :(
parent 4779baed
...@@ -84,13 +84,13 @@ ...@@ -84,13 +84,13 @@
############################################################################## ##############################################################################
"""Image object that is stored in a file""" """Image object that is stored in a file"""
__version__='$Revision: 1.9 $'[11:-2] __version__='$Revision: 1.10 $'[11:-2]
from Globals import package_home from Globals import package_home
from Common import rfc1123_date from Common import rfc1123_date
from string import rfind, split
from DateTime import DateTime from DateTime import DateTime
from string import rfind
from time import time from time import time
from os import stat from os import stat
import Acquisition import Acquisition
...@@ -116,6 +116,9 @@ class ImageFile(Acquisition.Explicit): ...@@ -116,6 +116,9 @@ class ImageFile(Acquisition.Explicit):
# attempt aggressive caching! # attempt aggressive caching!
ms=request.get_header('If-Modified-Since', None) ms=request.get_header('If-Modified-Since', None)
if ms is not None: if ms is not None:
# Netscape inexplicably adds a length component
# to the IMS header. Waaaa....
ms=split(ms, ';')[0]
mst=DateTime(ms).timeTime() mst=DateTime(ms).timeTime()
if mst >= self.lmt: if mst >= self.lmt:
response.setStatus(304) response.setStatus(304)
......
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