Not correctly processing "If-Modified-Since" in zope.app.file and z3c.blobfile

Bug #380895 reported by Kirill Kuzminykh
2
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.app.file
New
Undecided
Unassigned

Bug Description

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 not correctly compared.
Value of file modification date calculate as:
>> lmt = zope.datetime.time(modified.isoformat())
Value lmt has type float.

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

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

--------------
My solution this problem
--------------
Necessary change line:
>> lmt = zope.datetime.time(modified.isoformat())
on:
>> lmt = long(zope.datetime.time(modified.isoformat())

PS: sorry for my english

description: updated
summary: - Not correctly processing "If-Modified-Since" in zope.app.file
+ Not correctly processing "If-Modified-Since" in zope.app.file and
+ z3c.blobfile
Changed in zope3:
status: New → Won't Fix
Revision history for this message
Kirill Kuzminykh (cykooz) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.