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

Кирилл Кузьминых cykooz at googlemail.com
Sun Mar 7 15:37:47 EST 2010

In function zope.app.file.browser.file.FileView.show() (and
z3c.blobfile.browser.file.FileView.show()) file modification date and date
from Request Header "If-Modified-Since" are incorrectly compared.
Value of file modification date calculate as:
>> lmt = zope.datetime.time(modified.isoformat())
type(lmt) == float

Value of date from Request Header "If-Modified-Since" calculate as:
>> mod_since = long(zope.datetime.time(header))
type(mod_since) == long

As a result - lmt almost always is more than mod_since on some milliseconds.
For example:
lmt = 1243412922.51
mod_since = 1243412922

My solution this problem
It is necessary to change string:
>> lmt = zope.datetime.time(modified.isoformat())
>> lmt = long(zope.datetime.time(modified.isoformat())

PS: sorry for my English
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/bluebream/attachments/20100307/7b2c6af5/attachment.html 

More information about the bluebream mailing list