[BlueBream] Incorrectly processing "If-Modified-Since" in zope.app.file and z3c.blobfile

Cykooz cykooz at googlemail.com
Mon Mar 8 16:50:34 EST 2010


Ups, misprint...

2010/3/8 20:15 Baiju M <baiju.m.mail at gmail.com>:
>

> I can see that you are explicitly using `long` above, so the type
> will be long ?
> What is the value of zope.datetime.time(header) ?
>
> Regards,
> Baiju M


zope/app/file/browser/file.py
>>        header= self.request.getHeader('If-Modified-Since', None)
>>        lmt = zope.datetime.time(modified.isoformat())
>>        if header is not None:
>>            header = header.split(';')[0]
>>            try:    mod_since=long(zope.datetime.time(header))
>>            except: mod_since=None
>>            if mod_since is not None:
>>                if lmt <= mod_since:
>>                    self.request.response.setStatus(304)
>>                    return ''
>>        self.request.response.setHeader('Last-Modified',
>>                                        zope.datetime.rfc1123_date(lmt))

zope.datetime.time(header) - it is date of change of a file
transferred from browser.
It is compared to date of change of a file on a server - lmt.


More information about the bluebream mailing list