Incorrectly processing "If-Modified-Since" request header in zope.app.file

Bug #537263 reported by Kirill Kuzminykh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BlueBream
New
Undecided
Unassigned
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 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

Doctest for zope.app.file.browser.file.FileView.show() incorect tests "If-Modified-Since" request header, therefore errors was not.

I correct tests and code "zope.app.file.browser.file.FileView.show" method.

Revision history for this message
Kirill Kuzminykh (cykooz) wrote :
affects: bluebream → zope3
Revision history for this message
Tres Seaver (tseaver) wrote :

This bug should be tracked against the zope.app.file package, which is now released separately:

  http://pypi.python.org/pypi/zope.app.file

There is (currently) no Launchpad project for that package.

Changed in zope3:
status: New → Won't Fix
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.